- Home /
Make connected rigidbody pull "parent" rigidbody with joint
Is there any way I can make a connected rigidbody of a joint pull the rigidbody that has the joint?
Here is a GIF of what I want to accomplish
I need to make a sort of elevator pushed by pistons, so, my first approach was to use several joints and kinematic rigidbodies with a script, everything worked fine but one thing, if I tried to move the kinematic rigidbodies into a static collider they would just go through as they wouldn't have any sort of collision detection like the one non-kinematic rbs have
Then I tried to make a hierarchy of joints with non-kinematic rbs connected on each level, but it just didn't work
So now,I think the best approach might be using a fake collider that just scales to fake the pistons pushing an elevator, but as you can see in the GIF the child doesn't apply any pull force or any torque to the joint because it's a rigidbody with it's own velocity and params, so...
What should I do to make a physics model where a parent and child has 2 way connection but still remain somewhat independient (The parent moves the child but the child also applies force to the parent using its own force like a real joint would work on a non static parent)
Any guidance is appreciated :)
As I need to make an elevator, I need the physics model to be very very accurate, so, if the elevator is a child collider of the main transport object, if I move the child collider it will not update the main object velocity or torque because it's part of the Rigidbody the parent has, so, the only way of having the elevator to have its own values is making it a Rigidbody
And if you ask why I need the collider to update velocity and torque, it's because otherwise the physics engine will not calculate any friction or bounciness on the objects as it will read from the rb that the velocity is 0 and the torque is also 0, for example, if you move a kinematic rigibody ( without Rigidbody.$$anonymous$$ovePosition
and Rigidbody.$$anonymous$$oveRotation
to keep the velocity and torque at 0 ) with a non-kinematic rigidbody sitting on top, you'll see that the object on top will just slide no matter how you move your kinematic body
Hope this makes my question more clear :)
Do you need to keep their hierarchy as parent and child gameobjects?
No, I only need the group of gameobjects to make sense, it doesn't matter if the objects are separated or in hierarchy, I only refered to the objects as child and parent in my question because that's somewhat how the joints work given this circumstances ( Where the child can't control the parent behaviour on it's own but the parent can do control the child behaviour )
Your answer
Follow this Question
Related Questions
Rigidbody hover, bodies connected with joints should hover together. 0 Answers
Violent shaking when using position drive in Configurable Joints 1 Answer
Need Hinge Joint to interact with only one object, but still collide with others 0 Answers
How do I connect multiple spheres using joints and make a character? 1 Answer