Getting Accessed None

Hey, I am currently getting Accessed none from a blueprint reference to another by editing a variable in my other blueprint.

Firstly, I am aware that using things like GameState is a good store location for Variable’s however should it not work between two blueprints anyway?

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.

Thanks!

I don’t know if you did this, but you need to say at your Bp what is this reference variable

Don’t think I have.
How would I go about doing that?

Thanks

Is the Spawn Blueprint initialized?

You need to use a “Set”-Node.

I do not think so, if you could show me an example it would be great.

Is that what you mean below?
Still getting accessed none.
If you could mock it up, it would help more.

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.

Thanks

Hi,

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.

I hope this will help you a bit!