Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing speed between ControlPoints
#6
Here is an example:

Code:
        public void OnCPReached(CurvySplineMoveEventArgs e)
        {
            if (e.Spline.GetControlPointIndex(e.ControlPoint) == 2)
                e.Sender.Speed = 10;

        }

Add this method to a script (whatever it is), and then select an instance of that script as the object for your On Control Point Reached event, then select the method above.

You can see an example of usage of that event in TrainCarManager.cs, used in the scene 12 to handle the train junction.

If this explanation is not enough, please read this part of Unity's manual: https://docs.unity3d.com/Manual/UnityEvents.html
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Changing speed between ControlPoints - by funkd - 07-22-2020, 01:13 PM
RE: Changing speed between ControlPoints - by _Aka_ - 10-02-2020, 12:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
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_
  Changing range affects generated mesh GameJazz 10 33 12-15-2022, 08:28 AM
Last Post: GameJazz

Forum Jump: