Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Lanes
I want to trigger a change in lanes at key Positions. I have two Lanes connected by two bridges. I have set a waypoint at 25.3 for one, using the On Position Reached List. when the swap of lanes occurs, how can I set different points for each spline instead a common for all splines?
Kind regards

Attached Files
.unitypackage   Changing Lanes 01.unitypackage (Size: 11.08 KB / Downloads: 3)
.zip   Change Lane (Size: 2.36 MB / Downloads: 1)

I could not run your project properly since you seem to have forgotten the script machine asset associated with the ship controller.

Regardless, I see three ways of implementing lanes. Assuming you are switching between a spline A and B:
  • Static switches: Add a spline C for each lane switch you want, and use the Connections feature to connect spline C with A and B. Then setup the controller to follow the connections. This is what is done for the example scene you based your scene on.
  • Dynamic switches 1: Dynamically switch between spline A and B using the SwitchTo method. This is what is done in the example scene Space Runner, where you can switch when both lanes are next to each other.
    The documentation of said method:
  • Dynamic switches 2: Doing the switch by implementing a custom switching logic. For example, have a controller on spline A, and one on Spline B. Depending on which spline is the current spline, make the visible object (the ship's mesh renderer) either be on the controller A, the controller B, or moving between them (via a position interpolation for example).
I hope this helped
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

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 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
  Accessing generator's input spline in script, changing it at runtime smackledorf 3 815 06-17-2021, 01:59 PM
Last Post: _Aka_

Forum Jump: