Problem with RigitBody - 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: Problem with RigitBody (/thread-4124.html) |
Problem with RigitBody - Alexander34 - 06-03-2024 The problem is as follows: I have a code that creates a control point in the middle of the rope, then I create an attachment on the rope and attach it to the attraction point inside the object that I want to move with this rope. Since the attraction point itself is attached to the main RigidBody (box) through a fixedJoint, it starts to press it into other colliders, ignoring collisions, because the weight of the ControlPoint presses from above so strongly that it ignores the mass of the main object (box). However, I need to achieve an effect where pulling the attraction object would be difficult depending on its weight, and the lighter it is, the easier it is to pull it by moving the control point on the other end of the rope. Code: public void AttachRopeAtCurrentCenter(AttractionObject attractionObject) RE: Problem with RigitBody - josemendez - 06-03-2024 Hi, I'm not entirely sure I understood your description: you one rigidbody attached to the rope via a ObiParticleAttachment, and a second rigidbody attached to the first one via a FixedJoint. Is this correct? If you're using a dynamic attachment -as opposed to a static one, which ignores mass- this should work fine: the attachment will take into account the mass of the rigidbody it is attached to, and the FixedJoint will take into account the mass of both rigidbodies. Depending on the mass of the second (main) rigidbody, it will be easier or harder to pull it around. This is a test I've made using your setup (the way I understood it, at least): RE: Problem with RigitBody - Alexander34 - 06-03-2024 (06-03-2024, 11:56 AM)Хосемендес Wrote: Привет, Everything is a little more complicated, I have two default attachments for two players. Between them, in the middle in Play mode, I create a third control point "Dinamic" from the code and attach it to the AttractionPoint (based on your "Hook" script). Sorry if everything is too confusing, I think I've reached a dead end. RE: Problem with RigitBody - josemendez - 06-03-2024 (06-03-2024, 12:32 PM)Alexander34 Wrote: This seems to be the same thing I tested, the only difference is that the dynamic attachment is in the middle of the rope instead of one end? Would it be possible for you to share this scene with me (by sending it to support(at)virtualmethodstudio.com) so that I can take a closer look? RE: Problem with RigitBody - Alexander34 - 06-03-2024 (06-03-2024, 01:36 PM)josemendez Wrote: This seems to be the same thing I tested, the only difference is that the dynamic attachment is in the middle of the rope instead of one end? I resolved it in the following way. I retained only one collider with a mesh child object attached to the AttractionObject. Then, I shifted the child object downward along the y-axis by -0.5. Consequently, the Pivot of the main object ended up where the Attraction Point used to be. And now it functions properly.[/size] I didn’t bother to figure out why it works this way, but obviously there are problems with the child RigitBody and there may be a fixed joint. |