Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Obi Rope Prefab Pluger not working
#2
Hi!

Thanks for reporting this! The prefab plugger sample script accesses the smoother's "actor" property in OnEnable(), however the smoother also sets its "actor" property during its own OnEnable().

Since the order in which Unity calls events for different components is undefined by default, this may sometimes cause trouble when the prefab plugger's OnEnable is called before the smoother's.

Replace line 27 of ObiRopePrefabPlugger.cs with this:
Code:
GetComponent<ObiActor>().OnInterpolate += UpdatePlugs;

instead of:
Code:
smoother.actor.OnInterpolate += UpdatePlugs;

This will ensure it works regardless of the update order Unity decides to use.

kind regards,
Reply


Messages In This Thread
Obi Rope Prefab Pluger not working - by PRodi - 19-08-2024, 04:05 AM
RE: Obi Rope Prefab Pluger not working - by josemendez - 19-08-2024, 11:02 AM
RE: Obi Rope Prefab Pluger not working - by PRodi - 19-08-2024, 04:19 PM