Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Null reference when spline controller added runtime
#1
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:

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
Reply
#2
Hi
Here is the workaround. This will be fixed in the next Curvy update
https://forum.curvyeditor.com/thread-856.html
Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Filling a closed spline dynamically rickgplus 1 225 04-16-2025, 08:56 AM
Last Post: _Aka_
  Null Reference Exception rickgplus 1 267 03-01-2025, 02:09 PM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 678 02-04-2025, 09:31 PM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 284 02-03-2025, 09:34 AM
Last Post: _Aka_

Forum Jump: