Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing speed in splineController.cs
hi there,

How would i go about changing the speed variable in splineController.cs?

I'm wanting to make it that it can be changed globally from any other script. In the past i've done something similar to this:

public static float speed = 5;

But with the splineController code, I'm not sure what i need to do.

Any suggestions?

First you need to include the namespace:

using FluffyUnderware.Curvy.Controllers;

Then you can reference the Splinecontroller you want to access, like:

public SplineController xy;

Then you can access its values. For speed it is:

xy.Speed = 5;
Ah you're wonderful! Thanks so much for this great tool and prompt support. Can't wait to try it out later tonight!
So I'm just trying the above out now, the namespace line and reference seem to link in but the xy. Speed shows an error...

NullReferenceException: object reference not set to an instance of an object HitCollision.Start()...

What could I be doing wrong?

Thanks again ?
Please post your code.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Controler Speed from metadata Bryan Thatcher 1 5 05-24-2024, 08:41 AM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  Changing Lanes Antonio 1 11 09-17-2023, 08:23 PM
Last Post: _Aka_
  Changing material of Volume spot at creation? _RicO 5 11 08-11-2023, 09:39 AM
Last Post: _Aka_

Forum Jump: