I'm still looking into this, I've modified some of the curvy code to try and debug and what's trigger the assert is that the cachedTransform in CurvySplineSegment is null. It's like Update is being called before Awake.
Added this logging to debug.
I just tried having it used "this.transform" instead of cached transform and the case is still hit.
Something is marking the spline segment for destroy yet this update is still happening.
EDIT: So I made a refactor too allow Curvy to do the pooling for the segments instead of using our own logic and, with the pool on the segments enabled, the error does go away.
While I can use this in the short term, being able to control the lifetime of an entire curvy hierarchy is important.
We use addressables and some async code pretty heavily so it's possible some of the Destroy calls curvy was making weren't on the main unity thread leading to this issue. Maybe this is something that gives you an indication of how this can be safely allowed?
Code:
public bool HasUnprocessedLocalPosition
{
get
{
Debug.Log($"Unprocessed Local Position: {this.lastProcessedLocalPosition.HasValue} . CT: {this.cachedTransform != null}");
return lastProcessedLocalPosition.HasValue == false
|| cachedTransform.localPosition.Approximately(lastProcessedLocalPosition.Value) == false;
}
}Added this logging to debug.
I just tried having it used "this.transform" instead of cached transform and the case is still hit.
Something is marking the spline segment for destroy yet this update is still happening.
EDIT: So I made a refactor too allow Curvy to do the pooling for the segments instead of using our own logic and, with the pool on the segments enabled, the error does go away.
While I can use this in the short term, being able to control the lifetime of an entire curvy hierarchy is important.
We use addressables and some async code pretty heavily so it's possible some of the Destroy calls curvy was making weren't on the main unity thread leading to this issue. Maybe this is something that gives you an indication of how this can be safely allowed?

