Spawning multiple actors from same blueprint & function deletes the previous

Hey everyone,

I’m pretty new to UE and as a learning project, I want to recreate the classic “Frogger” game.
What I am getting stuck at is creating and moving actors across the screen (cars, logs, and crocodiles if you’re familiar with Frogger).

I call the function to spawn and move the actor across the screen at a constant rate, but when the function is called again and another actor is spawned, it deletes the previous actor from the scene. I know that there is something critical and basic that I’m missing. I’ve gone through tutorials and read some form Q/As, but I cannot seem to see my issue. I’d really appreciate some help. I’m attaching my blueprints below.

Thanks for any help you can provide :slight_smile:

Hello! Not sure, but Timeline is rather special thing, AFAIK it is created as commonly stored object and thus cant be played several times at a moment in one actor.

Place the timeline in the entity that you’re spawning. Set the Timeline to Loop and Autostart (inside the timeline graph). This way each actor that you spawn can have its own TL, with unique destination, speed, rate, and so on.


AFAIK it is created as commonly stored
object and thus cant be played several
times at a moment in one actor.

Sure, it just plays but one can absolutely move move multiple entities (and at different rates, too!) using the same Timeline. The TL provides an alpha - what happens to that alpha is up to the actor that receives said value. Setting it up would be, ofc, a tad more involved than giving each actor a separate timeline.

@Kehel18 I know you know this :wink: just throwing the idea around as it may be a valid option in some cases.

Mr Sloth, I don’t think the previous actor is getting deleted. It’s starting it’s journey again, with the new one exactly on top of it.

As Everynone says, you can use timelines to move multiple actors, but what would be easier, would be to make your croc a blueprint on it’s own. When you spawn it, it just moves across the screen and then dies. Then you can spawn lots of crocs, no problem.

Thanks, @ClockworkOcean, that makes sense. I’ll give that a try.

Thank you for the response, @Everynone. That makes a lot of sense. I’m going to give that a shot :slight_smile:

I’ve done as you all suggested by putting the timeline & movement in the croc blueprint and it worked like a charm!! Again, many thanks.