Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope Enable/Disable
#5
(04-07-2017, 04:54 PM)josemendez Wrote: I assume you are using pin constraints to attach the rope to the rigidbodies. 

What version of Obi Rope are you using? I can't get to reproduce this in the latest one. See this quick video (not the best quality ever, sorry Triste) I did of a relatively complex joint setup with rigidbodies and a rope, it can be disabled/enabled just fine. Disabling the entire GameObject yields the same result. Also tried two non-kinematic rigidbodies, one at each end and enabled/disabled them together with the rope object, works fine.

[Removed Video so I could add my own]

If using 3.1, would it be possible for you to share your scene (or a video of it) so that we can take a closer look?

If not, I'd recommend updating since 3.1 introduced much stabler pin constraints, and fixed a few rigidbody-related bugs. 

cheers! 

I am using 3.1.1 I believe, I've attached a few diagrams as well as a video/gif of the scene in question.

The following diagram shows the rope set up,
[Image: ViM1wCr.jpg]
A & E: Two 'Connector' models, which have Rigidbodies and mesh colliders further within
B & D: Two 'Anchor' objects, which have sphere colliders and rigidbodies, during runtime they are attached to the connectors via FixedJoints via a WireManager script
C: The Obi Rope instance, with some of the end particles being attached to the relative anchor objects

The WireManager script is mainly for some VR interaction stuff, dynamically changing the mass of the object at either end to allow certain interactions, however it does try to keep the positions of the anchor objects in the same place as it's paired connector object, The method responsible for this is as follows, and is called every FixedUpdate tick;
Code:
   /// <summary>
   /// Updates the position & rotation of the wirePoint to match the transform of the targetPoint
   /// </summary>
   /// <param name="wirePoint">The wire point to update</param>
   /// <param name="targetPoint">The target point to use as reference</param>
   private void UpdateTransforms(GameObject wirePoint, GameObject targetPoint)
   {
       wirePoint.transform.position = targetPoint.transform.position;
       wirePoint.transform.rotation = targetPoint.transform.rotation;
   }
If you would like the entire script that can be provided, but it would have to be through private channels (ie, via email) due to the nature of the project it's a part of Sonrisa

The following is the hierarchy setup for the scene, Point A and B are the two anchor objects identified above
[Image: n0aF19f.png]

Here's a video of the result when enabling/disabling the Plug Wire, Connection A, and Connection B objects, The same happens when also enabling/disabling the ObiSolver or Plug Wire's children with it. In the below video the rope is sitting on top of a simple box collider in order to make it easier to see Sonrisa


If I can provide any additional help, or if you'd like me to provide the scene, please let me know!

Thanks again!
Reply


Messages In This Thread
Rope Enable/Disable - by PhantomBadger - 04-07-2017, 10:43 AM
RE: Rope Enable/DIsable - by josemendez - 04-07-2017, 11:20 AM
RE: Rope Enable/DIsable - by PhantomBadger - 04-07-2017, 01:01 PM
RE: Rope Enable/DIsable - by josemendez - 04-07-2017, 04:54 PM
RE: Rope Enable/DIsable - by PhantomBadger - 05-07-2017, 09:51 AM
RE: Rope Enable/Disable - by PhantomBadger - 10-07-2017, 10:24 AM