Hi,
I have a Spline setup in my scene and i want to create objects at runtime that follow the spline. I'm using objects with a spline controller. these are then setup as prefabs. when i instantiate them i want to then apply an offset so they are staggered along the spline so after instantiate i want to call ApplyDeltaTime() on the controller with random values.
Problem is when calling ApplyDeltaTime() with a random value on the newly instantiated spline controller the position remains 0 on the spline so all objects are at the same position along the spline.
I suspect this is a bug and something hasn't initialised on the spline controller. or reinitialise after setting position.
Question is, is there a way around this?
In the sample project i have a sline and two controllers in scene and a prefab in assets with a controller. One controller in the scene is left at delta 0 which starts at the beginning and one delta 5. in the script the delta 5 is reference by the script and apply delta called passing in 5. this works and moves the object to delta 5, then the prefab is instantiated calling delta with 2 so this should result in three cubes moving along the spline staggered along the spline but the instantiated object remains at delta 0 start position.
I have a Spline setup in my scene and i want to create objects at runtime that follow the spline. I'm using objects with a spline controller. these are then setup as prefabs. when i instantiate them i want to then apply an offset so they are staggered along the spline so after instantiate i want to call ApplyDeltaTime() on the controller with random values.
Problem is when calling ApplyDeltaTime() with a random value on the newly instantiated spline controller the position remains 0 on the spline so all objects are at the same position along the spline.
I suspect this is a bug and something hasn't initialised on the spline controller. or reinitialise after setting position.
Question is, is there a way around this?
In the sample project i have a sline and two controllers in scene and a prefab in assets with a controller. One controller in the scene is left at delta 0 which starts at the beginning and one delta 5. in the script the delta 5 is reference by the script and apply delta called passing in 5. this works and moves the object to delta 5, then the prefab is instantiated calling delta with 2 so this should result in three cubes moving along the spline staggered along the spline but the instantiated object remains at delta 0 start position.