Obi Official Forum
Help distance constraints - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help distance constraints (/thread-776.html)



distance constraints - TootsManuva - 05-12-2018

I am new to Unity so thanks in advance for your patience folks. I have a simple physics game set up where the player moves platforms around to get a bouncing ball from one point of the "course" to another. I want to constrain the movement of these platforms by attaching a rope between them and another fixed object. The problem is that the rope will stretch forever, no matter how much I change the distance constraints, so it does not restrict the movement of the platform. I hope someone can point me in the right direction on this.

Thanks.


RE: distance constraints - josemendez - 06-12-2018

(05-12-2018, 04:46 PM)TootsManuva Wrote: I am new to Unity so thanks in advance for your patience folks. I have a simple physics game set up where the player moves platforms around to get a bouncing ball from one point of the "course" to another. I want to constrain the movement of these platforms by attaching a rope between them and another fixed object. The problem is that the rope will stretch forever, no matter how much I change the distance constraints, so it does not restrict the movement of the platform. I hope someone can point me in the right direction on this.

Thanks.

Hi,

External forces only affect non-kinematic rigid bodies, and rope can only apply forces trough pin constraints.

So if your character is a kinematic rigid body, or not a rigidbody at all (e.g. you're moving it by directly altering its transform), then no external forces (such as those applied by the rope) will be able to affect it and the rope will just stretch indefinitely in an attempt to follow it.

Same if you've used handles or fixed particles to attach it to the rope. You must use pin constraints.

See:
http://obi.virtualmethodstudio.com/tutorials/attachments.html
http://obi.virtualmethodstudio.com/tutorials/pinconstraints.html


RE: distance constraints - TootsManuva - 06-12-2018

(06-12-2018, 12:19 PM)josemendez Wrote: Hi,

External forces only affect non-kinematic rigid bodies, and rope can only apply forces trough pin constraints.

So if your character is a kinematic rigid body, or not a rigidbody at all (e.g. you're moving it by directly altering its transform), then no external forces (such as those applied by the rope) will be able to affect it and the rope will just stretch indefinitely in an attempt to follow it.

Same if you've used handles or fixed particles to attach it to the rope. You must use pin constraints.

See:
http://obi.virtualmethodstudio.com/tutorials/attachments.html
http://obi.virtualmethodstudio.com/tutorials/pinconstraints.html

Thank you so much for your explanation. I will look into alternative methods for constraining my character movement.