Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Limit GameObject Movement with Rope
#2
(20-04-2021, 11:52 AM)gigass21 Wrote: Is it possible to use Obi Rope to limit movement of game object?
I tried Chain example and from the editor tried to pull the object but it seems like it can't be tested like that. This is what I wanted to achieve, i wanted to test to tie a dog, so a dog will try to chase you but the dog movement will be limited to the rope that tied to the dog.

Sure, just make sure the object you attach to the rope has a rigidbody component. Rigidbodies in unity have mass and velocity, and forces can be applied to them. Obi will apply forces to any object attached using a dynamic attachment, but it needs to be a rigidbody. You can see an example of this in the included WrapTheRope sample scene. Once the rope is fully extended, it will turn red and you won't be able to pull further: the rope applies a force to the user-controlled sphere that prevents it from moving.




(20-04-2021, 11:52 AM)gigass21 Wrote: I saw it's possible when adding rigidbody, however it creates a big shakes on the gameobject, is it possible if it's IsKinematic Rigidbody?
When using IsKinematic, the rope just getting longer following where the dog goes.

A kinematic rigidbody has infinite mass. An object with infinite mass will push/pull all other objects around with infinite force, that's why the rope just follows the dog and does not oppose any resistance. Applying forces to a kinematic rigidbody has no effect.
Reply


Messages In This Thread
Limit GameObject Movement with Rope - by gigass21 - 20-04-2021, 11:52 AM
RE: Limit GameObject Movement with Rope - by josemendez - 20-04-2021, 12:29 PM