How to correctly use the GameState (for a single player game)?
For my singe player game I need to spawn a bunch of enemies at certain locations within the game world (map). So I thought I would simply create a local array in my GameMode actor, spawn the enemy at the map's target point and-- well, how would I access the target point actor in the current map from within the GameMode BP?
Then I asked myself: should the GameMode access the current map directly at all, is that the correct place to do something like this? But how else can the GameState keep track of what's going on in the game world, if it cannot access it and its actors?
I also played with the thought of adding this array of enemies and their spawning logic into the level BP. But then I thought I would need to copy this spawning logic from one level BP to the other, if only the map changes but not that logic. So it seems that logic should indeed end up in the GameMode -- or at least that is how I understand it.
Could you guys please help me to understand this interaction of GameMode - Current Map - Level BP? Thanks a lot in advance!
asked Jun 08 '15 at 12:52 PM in Blueprint Scripting
GameMode is ok. You can find all "Enemies Spawn Point" actors using "GetAllActorOfClass" https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/index.html
answered Jun 08 '15 at 01:02 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here