Best strategy to add object with Mass to middle of rope. - 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: Best strategy to add object with Mass to middle of rope. (/thread-3715.html) |
Best strategy to add object with Mass to middle of rope. - idmah - 28-12-2022 Hi All. I've got a way to "teleport" an object to my obi Rope. But that strategy doesn't effect the behaviour of the Rope. FYI the rope is being dragged behind rigidbody object. Ultimately I'd like to add an object to any point. Length float 0-1 on the rope. and have the rope behave physically correct. If someone can point me in the right direction, where to look in the documentation. or a code fragment. it would be greatly appreciated! thanks! ps. Sorry if this is a repeat of some other post. Note: Just to be specific, basically I want to throw sticky weights or in my case zombie at a rope and have them stick there, whilst the rope reacts physically correct to the new masses. RE: Best strategy to add object with Mass to middle of rope. - josemendez - 09-01-2023 Hi! If you don't need two-way coupling (the rope both receiving forces from and applying forces to the object), the simplest approach is to use the path smoother's GetSectionAt() method. It takes a float in the 0,1 range as parameter and returns an orthonormal frame in the rope's path, which you can use to place the object. The included ObiRopeAttach utility script uses this method, you can just place it on an object and it will follow the rope. Now, if you do need two-way coupling (which would seem the case since you mention "whilst the rope reacts physically correct to the new masses.") and want this to happen as a reaction to a collision against the rope, it's considerably more complex as it involves collision callbacks and runtime constraint creation: - Detect collisions between the rope and other object. This can be done using collision callbacks: http://obi.virtualmethodstudio.com/manual/6.3/scriptingcollisions.html - Create a new pin constraint at runtime. See: http://obi.virtualmethodstudio.com/manual/6.3/scriptingconstraints.html kind regards, |