I hope the annotations help understanding what is going on.
However, with the target set as the blueprint it still seems to access none at “Set Zombies Alive”.
spawnVolume reference:
Thanks, any help is appreciated.
However, if you are going to suggest storing the variable else where then please don’t. The spawnVolume blueprint gets pretty complex with it.
On the other hand, if you know there is no way to make this way work… then by all means let me know.
Or do I need to link anything?
I tried both linking input of Set to Get Spawn Blueprint and output of set to set Zombies Alive. Both giving accessed none.
I’m guessing that you are spawning your enemies from your ‘SpawnBlueprint’, and you want to send info back to the spawner right?
Go to the properties of your ‘SpawnBlueprint’ variable and click the ‘Editable’ and ‘ExposedOnSpawn’ checkboxes. These options will expose this variable to the ‘SpawnActorFromClass’ node. This means, that in your spawner, where you spawn your zombies, simply connect a ‘Self’ reference (right click-get a reference to self) to the exposed ‘SpawnBlueprint’ input.
After this, you shouldn’t get Accesed None error anymore.
The reason you are getting it now is (as others mentioed) that you haven’t initialized your variable and give it a value, it is currently null (‘SpawnBlueprint’ is only the type, you also need a value).
Imagine if you had 2 spawners in your level, and any of that 2 spawners can spawn zombies, and you want to check how many zombies are alive spawned by a certain spawner. When you would add 1 to your ‘ZombiesAlive’ variable, you would want to change the value in the spawner that spawned the zombie. But if you wouldn’t initialize it (give it a value), how would the game know which spawner to add 1 more alive zombies to, there are 2?! By exposing the ‘SpawnBlueprint’ and inputing a self reference, you tell your zombie when it spawns which spawner belongs to him, so he will know which spawner to update.