Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Lost solver parameter from rope
#2
(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()?
Reply


Messages In This Thread
Lost solver parameter from rope - by flaurens - 01-09-2020, 11:17 AM
RE: Lost solver parameter from rope - by josemendez - 01-09-2020, 11:24 AM
RE: Lost solver parameter from rope - by flaurens - 01-09-2020, 11:25 AM
RE: Lost solver parameter from rope - by flaurens - 01-09-2020, 11:44 AM