How to fix blueprint error for changing speed of ai based on amount of ai killed?

Hi, I get alot of errors from this branch node and dont know why.

I have a kill counter on the player BP and have referenced it in the Ai BP for when the player kills more Ai the faster the ai walking speed gets.

The reason you’re getting all your errors is that you are trying to access a variable out of scope.

Tick runs constantly from the time the actor is created until the actor dies.

You need to store a variable to the player controller when “OnSeePawn” triggers and the cast succeeds. Then, in Tick, you check first to make sure that variable is valid, if it’s valid then you get the kill counter from it. Otherwise do nothing.

Thanks Majin! What do you mean by out of scope?
To do this would i create a variable in the firstperson_BP? Then in the ai_BP have the is valid node?

Your AI_Character needs a variable reference for FirstPersonCharacter.

In the AI_Character Tick is where you would check that variable.