Hi!
I’m quite a beginner in UE4 so excuse me if this is trivial to some.
I’m having some trouble understanding how I can create six spawn points that can spawn random characters.
The characters are just some mannequins for now that will have different abilities. I want them to at the start of the game spawn randomly at different positions. My problems now are that I cant seem to “delete” a spawn point if it’s already has a character there. Which leads to multiple characters spawning at the same position. My progress now is that of this tutorial UNREAL ENGINE 4 :-Random spawn of a bluprint using target points - YouTube , just with added “items”/characters. I know this won’t work but I wonder if someone has a good solution for this?
You could always trace for hit before spawn, that would remove the need to delete spawn point. Or if you need six spawners and you have 6 spawn location, just assign them a different spawn location, when you do the random int generator then do a check for duplicates.
If on the other hand the enemies will spawn repeatedly then your need to do a trace, perhaps a collision box on box trace the extent of the spawn location (remember movable pawns have a collision capsule), if trace finds something remove spawn options from that spawn. I.e check condition, condition = true (hit something) then branch would not go through spawn routine.
You can “get all actors of class” when spawning and use “get distance to”. Then use a branch based on a minimum distance to the nearest character, and spawn if true, or recast if false.
Else set a timer bool on the spawning point, and again make a branch that checks if the bool is activated or deactivated.