Actor wont travel on spline

What am i doing wrong?

When i get into the car and i click spline 1 the car teleports to the spline but then does not move…According to the blueprint it should be moving…wth is going on

From what I can see, I suspect you are simply not setting the correct distance. Spline distance is based on the actual length of the spline, not on a normalized value. In your timeline I see that you are animating to a max distance of about 5 over a period of 15 seconds, but in Unreal units, that is almost nothing. I suspect your car IS moving, but it is moving so slow it may just as well be standing still.

I think it would be best to animate your timeline from 0-1, and multiply that track output with the spline length. That way the timeline can be used for all splines (which is important, since you have potentially multiple splines whose length can (vastly) differ).

In case you need the car to move at a constant speed (considering you used a speed variable), it is better to abandon the timeline entirely (since timelines are fixed in length, and with variable spline length and a constant car speed you would need timelines with variable length to move your car). It would be better in that instance to delete the timeline bit and simply call that custom event from the Tick.

What about if i wanted the car to speed up half way or at specific points along the spline? Sorry if the questions i ask are not so easy to answer. I am very new to splines xD and since making this thread I have some how buggered up the possessing of the car -,- The struggles are real.

I got this from a youtube video and his works…mine doesnt…There is nothing different to his code to mine. yet mine wont work.

If you want to speed up the car halfway along the spline, get the spline length, divide it by 2 and do a check whether the current traveled distance along the spline is equal to or bigger than the half spline length. When that is true simply speed up the car. If you want to do specific points, it depends on whether you want those points to be fixed at a specific distance or based on a percentage (like after 25% of the spline).

For specific points, simply setup an array of variables or something and everytime you update the location of your car, compare your current distance to the variables you set. If something returns true, do something. If you want percentages, simply do the above thing with getting the spline length and dividing it by some value.

Going by this screenshot, you would have to connect the play from start or play from the timeline to some event. Right now the timeline simply isn’t being called.

It’s a bit superfluous to add the world delta seconds to the game time first though. World delta seconds is the time since the last tick, so that value is like 1/60th of a second (or worse if your framerate is higher). Since that is near 0, just using the game time should be more than enough.

Also, something that may happen in this instance is that your car skips ahead of the curve. This is because gametime starts ticking the moment the game start. If this blueprint is, say, started 5 seconds after you start the game, the gametime will essentially already be 5 seconds. If you want to prevent this, make a “start time” variable that you set to the current game time before you start the timeline. Then, when updating the timeline use the current game time minus the start time variable you created so you have a nice count starting from 0.

Ok, first of all a couple of key points. That blueprint is the actual object I wanted to move(car) and secondly, that is EXACTLY the same blueprint layout the guy had it in the video and his car moves and mine didnt.

BUT I have fixed the issue now and I got it to work. I also managed to make it so each spline track has an index and I can choose which spline track to follow depending on what index i set in the menu widget buttons