In my game, I want the player to be bale to grapple onto and jump over some bendy stuff, that act like rubber, kinda like those rods in a bouncy castle.
I made some, and sofar double hinge joints worked out the best, but this way sometimes the rod can do pretty wacky stuff and I want to avoid that (Both self and joint collisions have been turned off, so the capsule colliders don’t bug eachother out even more.). If I do it with spring joints the rod just collapses and does all kinds of weird stuff. What would be the best way to go about this?
Please note that this doesn’t describe any problem that can be solved. The video doesn’t help to clarify that either. There’s no indication what is causing what to move. I presume you’re not just stomping over the Transform and expecting the solver to figure out what’s going on but are in-fact applying forces to bodies? You cannot just instantly teleport things with chained joint set-ups; the solver is never going to be able work with constraints if that’s happening.
I’m not sure what you mean. Do you mean something more akin to a high-jump pole so a flexible pole?
Sorry for not being more clear about things. In the vid didn’t make things clear enough.
Yeah I want something like a jumping pole.
The pole I’m using is rigged up, and the bones are connected using Hinge joints, but they go both ways so they become somewhat rigid and they don’t just go flopping around. They have capsule colliders on them and thri rigidbodies are set to have no gravity.
Nothign else is on them, no bonues forces, just hinge joints, a capsule collider and a 0 gravity rigidbody.
The wacky stuff that is not clear enough from the video is basically, sometimes the pole after intercting with it, just starts moving on it’s own, other times it just get’s bent and it keeps being bent while wriggling. I’m assuming that it’s some sort of physics bug because you are not suppose to use double hinge joints, and by double I mean they go both ways, so they wouldn’t be able to move, but instead they make this bendy effect, which has some bad quirks.
I want to know what’s the best way to go about figuring this stuff out, without making the Physics engine go haywire. Like is there a workflow or something, for making more advanced physics objects?
Why must it be a bug? In the end this is a simulation and joints don’t know about each other. Each produces impulse forces to solve their own constraints. If those constraints compete then you need to give the solver time to actually solve them. I presume you’ve not tried increasing the number of iterations the solver can use to solve this complex joint set-up? If not then you should.
You’re saying high level things like this but I don’t see “haywire”, I see you wanting the hinges chained together to be stiff or somehow have damping? Hinges don’t have any of that yet you want it to have some intrinsic damping. If you use them and you want damping then you need to add that to the bodies via their linear damping. Hinges do have limits; you’ve not mentioned those but I presume you’re using them? Are the limits narrow?
Also, as I asked above, you’ve not indicated how these bodies are being moved. You interact with them in the video so again, how is that interaction done? You’re saying no forces etc but how is it moving?
To me it sounds like you want to perhaps use a FixedJoint and offset the connected anchor to the connection points between the bodies. You can set frequency and damping here. Also, I’ve asked a few times but you should ensure you’re not modifying the Transform here and bypassing what the Rigidbody2D/Joint2D are trying to do.