- Home /
Fire hose - Dragging Issue
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!
Update The toolpoint (empty GO with rigidbody) I attach the hose to via a fixed joint has significantly left it's position and is up in the air, ins$$anonymous$$d of being in front of the main camera. I've got the constraints on in rigidbody.
Can anyone suggest how to stop it moving?
Answer by RaptopLob · Aug 23, 2011 at 12:53 PM
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.
Answer by roamcel · Aug 22, 2011 at 12:14 PM
'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 killed the crazy movements thanks to your comment about intersecting.
However it will not rigidly attach to the player :(
Joints are extremely difficult to master, so it's quite probable that you're missing some essential parameter set up (can't really help you there). Just to verify this, go into play mode and manually parent the attach point of the hose into the player's designed transform and see if it behaves as expected :)
Thanks for the help roamcel but I've just figured it out, nothing to do with joints, ins$$anonymous$$d I needed Is$$anonymous$$inematic! Thank again!
Your answer
Follow this Question
Related Questions
weird behaviour configurable joint Strecthing when Draging 0 Answers
Scripting troubles, dragging to bend hinge joints 1 Answer
How to Stop a Game Object from Passing through a Collider while it's being Dragged? 3 Answers
Drag Rigidbody 2 Answers
How do I connect two objects together in the scene? 1 Answer