19-08-2024, 11:02 AM
(This post was last modified: 19-08-2024, 11:02 AM by josemendez.)
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:
instead of:
This will ensure it works regardless of the update order Unity decides to use.
kind regards,
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,