06-19-2020, 02:32 AM
Hi there,
I have a gameobject on which I am adding a SplineController component at runtime. As soon as I assign an existing spline to the Spline property though the follow exception throws:
Which is the line:
onInitialized is null
Interestingly, if I remove my added SplineController and add another one using the editor at runtime it works fine. So I guess my question is, after adding a SplineController dynamically at runtime is there something else I need to do to initialize it correctly?
many thanks
John
I have a gameobject on which I am adding a SplineController component at runtime. As soon as I assign an existing spline to the Spline property though the follow exception throws:
Code:
NullReferenceException: Object reference not set to an instance of an object
FluffyUnderware.Curvy.Controllers.CurvyController.Initialize () (at Assets/Plugins/Curvy/Controllers/CurvyController.cs:827)
Which is the line:
Code:
onInitialized.Invoke(this)
onInitialized is null
Interestingly, if I remove my added SplineController and add another one using the editor at runtime it works fine. So I guess my question is, after adding a SplineController dynamically at runtime is there something else I need to do to initialize it correctly?
many thanks
John