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


Messages In This Thread
Null reference when spline controller added runtime - by jh092 - 06-19-2020, 02:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to merge intersecting meshes at spline connections? Reign_of_Light 2 3 03-20-2023, 08:36 AM
Last Post: Reign_of_Light
Video Spline Gizmos & Segments Invisible while Drawing ricke 7 14 03-13-2023, 05:31 PM
Last Post: _Aka_
  How to fill a closed spline with mesh FanManPro 6 6 02-25-2023, 09:44 AM
Last Post: _Aka_
  How can I attach the component to the mesh generated from the spline? Chanon 1 3 02-11-2023, 09:17 AM
Last Post: _Aka_

Forum Jump: