I have some actor spawn points just off screen above my view. They spawn some actors that slowly fall down. I would like these spawn points to always stay above the character just off screen.
How would I controll the “Z” parameter of the spawn points to be "player character Z + (amount)? But constantly changing?
The spawn points would need to be in an actor (e.g. BP_SpawnPoints). Then you move the actor on tick with conditional checks before move.
On tick get Capsule Component world location and compare it against the SpawnPoint actors location (distance between the two should suffice). If distance is greater than n → move to current location.
Set actor location w/capsule components world location.
@ClockworkOcean is right about only moving it pre-spawn.
When you need to spawn your actors, compare locations of the two. If you need to move, then move. Then call spawning.
Thank you, This is working for me so far. I’ve just go some cleaning up to do on my end.
Wanting to adjust it now to randomly spawn from a wider area but always at around that height above me. I was able to make some target points and reference those with a random array function to randomly spawn from the points I made. Now i’ll try to merge that with this to keep it above me.