Obi Official Forum

Full Version: Instantiated Rope w/ Pin Constraints Causes Unity to Crash (5.6.1 & 5.6.2)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

My name is gxiv (gee-fourteen.) I'm currently experiencing the following bug with ObiRope in Unity 5.6.2 (/1):

I've made a prefab for a rope that has all the properties I desire.
I want to instantiate this prefab with a mouse click, and have pin constraints generated on both ends of the rope.
If I include the pin constraints on the original prefab, then on instantiation of the rope Unity will freeze and crash.

I see there being two possible solutions:
1. I dynamically add the pin constraints when the rope is instantiated. I'm unsure of how to do this right now but believe it might be done through the main ObiRope script or the ObiRopeCursor (not ObiPinConstraints, oddly enough [correct me if I'm wrong!])

2. I continue with the method I am trying right now (with the pin constraints built into the prefab) and try to avoid whatever is crashing Unity. I'm less optimistic that this approach will pan out, as including the pin constraints in the prefab feels very dirty to me (though in terms of the problem there is nothing conceptually wrong with it, because the two ends will always be pinned to the same two rigidbodies.)


So yeah.. If any one has any advice on which of the two approaches I should follow, how to dynamically pin particles of a rope, or how to avoid the crash I am getting - I will appreciate any ideas you have to share!

cheers,
gxiv