Initial Spawn Movement with Splines

Hi everyone!

In my project I want to spawn enemies and then have them enter the battlefield in interesting and unique ways. My thought was to use splines to get my flying units onto the field and then detach them from the spline and let the behavior tree take over movement/AI control from there. I created a vertical spline and I think I would want to use the “AttachActorToComponent” on spawn and “DetachFromComponent” once the flying unit has made it through the spline but I’m getting very confused as to where I want to put this logic. Should it go inside of the character traveling on the spline? In the spawning system? Inside the Spline itself?

I am still pretty new to UE4 so if there is a better method please feel free to suggest others as well.

Hi Sidera

Put the logic in the enemy itself. It’s the only logical place.

One way to go about this, would be to let the spawner put a spline in the world, then spawn an enemy and tell the enemy where the spline is.

The enemy then knows how to follow the spline and when it reaches the end, uses the navigation mesh.

The enemy can just use a timeline to follow the spline, you don’t need any ‘attach this to that’ stuff.

Another way, would be to use a bit of math to get from the spawn point, down to the nav mesh. Possibly some sort of spiraling movement or randomized path.