Actor only following spline when spawned at start, not when spawned later in game

Hi,

I have a setup in which I have an actor follow a spline to get to a destination. When I spawn this actor together with the spline, whether at level start, or streaming a sublevel later in the game, everything works smoothly.

However, when I stream my level in and don’t spawn the actor immediately, the actor doesn’t move along the spline anymore when spawned. I’m using the same spawner and exact same actor, the only difference is the timing of the spawn. The actor searches for the spline and does find it, he correctly calculates the next point along the spline he should go to, but just refuses to actually move.
In the underlying image, the top one works (assuming I spawner the actor at level load), but the bottom doesn’t.

Anyone know why this behaviour may occur?

It’s hard to take a guess, but since you mentioned it does find the spine in the second case, can it be actually doing what it’s supposed to? Maybe it doesn’t get told to move to another destination once one travel succeeds. If that’s not it though, can it be because of the order your code runs? We should inspect your moving algorithm

The moving itself never changes. So I don’t get why it should react differently when the actor is spawned later in game. Basically, I have different splines with tags, when I need one I look for the correct one, and then move the actor along the spline.


When I check in the second case, the destination is getting set (and is different from the world location), so there is a vector being inputted in the ‘Add movement input’, but that is not getting executed.

The same code works flawlessly when the actor is spawned at the same time as the spline, namely at the load streaming level (both spline and the actorspawner are in the same sublevel).

Can you also provide the screenshots of your blueprint where these functions get executed?

I activate tick when I want to use the spline, and deactivate it afterwards.
The percentage stays at 0% is my second case sccenario, so it just stays tickting and never reaches the end. When I spawn them earlier, the percentage moves nicely along to 99.9… % and so it stops when it has reached its destination and stops the tick as expected.

Since you also mentioned that it also calculates the correct destination in your first post, it seems like the issue isn’t about the algorithm if I’m not missing anything. Could you also show when and how you trigger these functions?

It’s easy, the ‘Come’ function from my first post is like this:


(With the correct tag of course)
This ‘Start Spline’ activates the tick in my previous post. This functionality works perfectly in case 1, but for some reason not in case 2 (although the destination is correctly calculated).

So for clarity:
Case 1: Spawner and Spline are located in same sublevel, spawner spawns actor at beginplay and I can call the ‘come’ function whenever I want and it works.
Case2: Spawner and Spline are located in same sublevel, spawners spawns actor on a command later in the game (see post 1), and then when I call the ‘come’ fuction it still fires, starts the tick, but does not update the location.