I’m trying to make a hose that the player can pick up at one end and drag around.
I have a chain of cylinders working with hinge joints, which is messy but will do for now.
I have a ‘toolpoint’ within my player character which works fine for spawning usable tools.
When I attach the toolpoint’s rigidbody to the end of the chain via a fixedjoint, it doesn’t move from it’s position but does respond crazily to the movement of the player.
Can anyone suggest a way to achieve my goal? Thanks!
‘crazy’ movement on physics driven objects is usually because of intersecating/compenetrating colliders.
As a test to verify this out, I suggest you reduce the colliders sizes to be completely sure that they don’t intersecate in the ‘relax’ position of the hose.
Additionally, be sure to set the rigidbodies masses appropriate values: there’s a relation between item dimension and rigidbody mass, so assign weights that would be similar to those of the segments of a real life object of the same dimensions you’re using.
I’ve resolved the attaching of the hose to the player, the option I was needing was ‘Is Kinematic’!
So, to be able to drag your cable/chain/rope/hose:
Create the thing with hinge joints with all parts NOT using IsKinematic at this time.
Add a script to the end you want to drag/attach that will do the following when requested:
- Turn ON IsKinematic for itself ONLY
- Position and rotate it using its transform
- Parent it the desired object, in my case the character’s hand
Now the physics engine will drive the movement of the hose through the non-physics end that is attached to the player.