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.
asked Nov 04 '16 at 03:40 AM in Blueprint Scripting
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.
answered Nov 04 '16 at 01:36 PM
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?
answered Nov 04 '16 at 01:54 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here