How to make a spline track with track switching?

I’ve seen a lot of tutorials on how to use splines to make trains, but its not exactly what I’m looking for. I have a character that I want to move like a train. I want it to follow a set track, but sometime, I want it to switch, and follow that spline track to a connector to a different spline track, and then use the new one, just like a train rail switching. Is that a possibility with splines?

from my experience thats a solid kinda. the only thing i can think of would be that you would need a way to tell the character to get from one spline to another. so for example lets say you have two loops that touch at one place. you could have a overlap event there that checks a bool to say whether to switch tracks. if true then at the switch point you would need a script to say switch now to X position on spline 2.

ok now for a real example. in this example i have a cone(character) moving along a spline which intersects with another spline (both are actors containing a spline component), then where they overlap i placed a cube and the cone will switch tracks moving in a figure eight. each time the cube is overlapped the cone will switch splines.

on begin overlap cube we get the overlapping actor and make sure its the cube. then we figure out which track we are currently on and set the variable currentSpline to the other track, if currentSpline now set to spline1 then reset it to spline2 (that takes us to the set CurrentSpline node). next we figure out the closest point on the new spline to where we currently are. to do this we we get input key closest to location which will return a number in relation to spline points so if we are halfway between point 3 and 4 it will return 3.5. if we divide this number by the number of spline points minus 1 (for loops) then we get a percentage of how far along the spline we are. if we multiply the percent by the spline length we get out location along the spline. i then set this to a variable.

for the movement i used the simple on tick move one unit along the spline. we can take our variable and convert it to a world location via get location at distance along spline then set the character location.

you could probably make something similar as its own actor and have the spline references as variables and accomplish your task. its a bit complex at first but once you get how it works its not too bad.