01-09-2020, 11:24 AM
(01-09-2020, 11:17 AM)flaurens Wrote: Hi!
I was duplicating a prefab that consists of an ObiSolver (parent) and a Rope (child) with 2 game objects with rigidbodies. The original prefab has a script that I use to subscribe to the event OnCollision. That script requires the rope in order to perform a Tear, so that way I can simulate a cut in the rope. In that script I subscribe to that event doing the following:
Code:m_Actualrope.solver.OnCollision += CutTheRope;
m_ActualRope is ObiRope type.
The issue starts when I duplicate the prefab, because it seems that the m_ActualRope is always null on that prefab clone.
Is that a bug?
Regards!
Prefab management is entirely done by Unity, not Obi. This entirely depends on how you're setting the m_ActualRope variable in your script. Is this a public reference that you're dragging the rope into in prefab edit mode? Are you setting this variable trough code in Awake() or Start()?