Hello guys!
So, I am working on this train system with stops, but I don’t really know how to make it stop on a specific point. I did a prototype that works, but is not 100% accurate, I need help.
Let me explain how the system works:
-
The train will move along a spline which is generated procedurally.
-
The speed is handled by a timeline:
- The movement is handled by the event tick. The starting distance is 0 and if it is lower than the spline length, the move function will be fired to move the train:
- There is also a BP_Station, with a collision box, and every time the train overlaps it, the “STOP” event will be fired and speed will decrease thanks to another timeline:

Now, my problem is that sometimes the train will stop at different locations, even if the station’s collision box is always there.
Do you have any suggestion to make my train always sto at the same spot? Thanks in advance!
This all sounds like a real train to me 
If you really want it to stop at an exact spot, then you need to switch all of this stuff off on overlap, and use another timeline, to take it from the overlap point, to the stop point.
Thanks man! 
So you would suggest to add another timeline to the BP_Station whenever the train overlaps the box collision, is that correct?
Yes. It’s too difficult to do with your tick method.
So when it hits that buffer, just totally switch to a new TL, that will make sure it always lands in the right spot.
Mmmmh ok, so I might add a bool to the train BP to switch off the movement logic and then add this new timeline in the station BP.
What is not totally clear to me, is how to setup this new timeline to make the train arrive to a specific spot.
Sorry for all these questions, and thanks for your patience! 
You have it’s current location ( on hitting the box ), and the stopping location ( on the spline ).
So you can lerp between the two locations, using a TL.
There is any way to get the location of a specific point on the spline?
Not a location in space ( otherwise it will come off the spline ). Distance along spline, I meant.
Awesome, thanks a lot.
I’ll try to make it work, thanks!!!
1 Like
You could use either of these, I think

Thanks, I was trying to make it work but I found a couple of issues.
First of all I created a new collision box on the BP_Station, so on overlap it can take the location.
But the real problem is that I can take the distance of the train (there is a “distance” variable in BP_Train), but I can’t do the same on the BP_Rail. So I don’t really have a way to have the distance on the stop location.
I am looking for a different solution.
Even getting the point index seems impossible. I am trying different approaches.
When the train overlaps, you know it’s location, that’s one point. The other is also known, the station.
There’s a node called something like ‘nearest point on spline to world location’ ( extremely approximate name, I’m not at a machine rn
)
Also, why not organize it so that there’s a spline point at the overlap, and another at the station.
Many options 
Awesome, I’ll search it, thanks!
Hi there @SpaceAce_717,
This topic has been moved from International to Programming & Scripting: Blueprint.
When posting, please review the categories to ensure your topic is posted in the most relevant space.
Thanks and happy developing!