09-11-2022, 11:40 AM
(This post was last modified: 09-11-2022, 11:42 AM by josemendez.)
Hi!
Are you aiming to do this at runtime, or at edit time? Attachments don't modify either the rope or the position of the object it is attached to, they attach a particle in the rope at its current position relative to an object. Quoting the manual: http://obi.virtualmethodstudio.com/manua...ments.html
If you are doing this at runtime, and you want the rope to have a specific shape/length that ends up at a given object, you need to create the rope at runtime. See:
http://obi.virtualmethodstudio.com/manua...ctors.html
If you are doing this in-editor, the best option is to drag the control point to the object. The only other possible options are to force the position of a rope particle to that of the object (which would stretch the rope, and it would spring/kick back to its rest length as described above) or moving the object to the position of the rope control point/particle.
A single rope can be attached to as many objects as you need. Just make sure the spheres are children of the plate and that the plate has a rigidbody component (and the spheres do not), otherwise they will just move independently from each other.
Not at all, the solver represents a simulation. In fact you must use a single solver for your ropes if they are all part of the same simulation, otherwise they will not interact with each other, neither directly or via objects they are attached to. See:
http://obi.virtualmethodstudio.com/manua...cture.html
http://obi.virtualmethodstudio.com/manua...olver.html
Make sure your attachments are dynamic (otherwise rope particles will follow the object they're attached to without applying any forces on it), and that the mass of the plate isn't much larger than the mass of your ropes.
kind regards
(09-11-2022, 10:53 AM)rohit_dhak Wrote: 1. How to easily attach the ends of the rope to other objects (I cant just drag the control points to the objects).
Are you aiming to do this at runtime, or at edit time? Attachments don't modify either the rope or the position of the object it is attached to, they attach a particle in the rope at its current position relative to an object. Quoting the manual: http://obi.virtualmethodstudio.com/manua...ments.html
Quote:It's important to realize that attachments do not move the particle group to the position of the target object, nor the target object to the position of the particle group. Moving the particle group to the target's position would collapse all particles into a single point, and would result in a kickback effect once the particles spring back to their original positions. Moving the target could cause a whole palette of issues depending on your game logic.
Instead, particles in the group are attached at their current position relative to the target object. This makes it simple to work with multiple particles, and ensures smooth attachments with no initial "jumps" or sudden motions.
If you want particles attached at a specific position other than their position at the time of creating the attachment, you can set their position at runtime before creating the attachment: see scripting particles.
If you are doing this at runtime, and you want the rope to have a specific shape/length that ends up at a given object, you need to create the rope at runtime. See:
http://obi.virtualmethodstudio.com/manua...ctors.html
If you are doing this in-editor, the best option is to drag the control point to the object. The only other possible options are to force the position of a rope particle to that of the object (which would stretch the rope, and it would spring/kick back to its rest length as described above) or moving the object to the position of the rope control point/particle.
(09-11-2022, 10:53 AM)rohit_dhak Wrote: 2. The main object (at the center) is a plate with 4 speheres on the corners (multiple object body), so when I am attaching the rope to the sphere and run the game the plate just fallsĀ while the sphere is still attached to the rope. Does it mean that I can only attach the rope to a single body object?
A single rope can be attached to as many objects as you need. Just make sure the spheres are children of the plate and that the plate has a rigidbody component (and the spheres do not), otherwise they will just move independently from each other.
(09-11-2022, 10:53 AM)rohit_dhak Wrote: 3. I want to control each rope separately, do I need to have separate obi solver for each rope?
Not at all, the solver represents a simulation. In fact you must use a single solver for your ropes if they are all part of the same simulation, otherwise they will not interact with each other, neither directly or via objects they are attached to. See:
http://obi.virtualmethodstudio.com/manua...cture.html
http://obi.virtualmethodstudio.com/manua...olver.html
(09-11-2022, 10:53 AM)rohit_dhak Wrote: 4. Also I want to have the plate body hanging like in the freight lift example, however in my case the plate body just falls on the ground, How can I restrict the ropes extensions unless and until I give some control inputs to the ropes?
Make sure your attachments are dynamic (otherwise rope particles will follow the object they're attached to without applying any forces on it), and that the mass of the plate isn't much larger than the mass of your ropes.
kind regards