Download

How Do I Make the Behaviour Tree Set A Bool in Enemy Character Base Class

Hi. I have been stuck for hours on this one, and I can’t seem to get it to do what I want.

My Behaviour Tree has a move to player node that works fine.
When the enemy gets close enough to his destination.

I want the next behaviour tree task to Set a Bool Value within the Base Class of the character (IsInAttackRange = true)

Does anyone know how to do this?

For simple stuff like this I love using blueprints for AI commands

Create a task, and start with this:

d141451066797f9615c75059f4037c0fcf887e8d.png

Basically, it allows you to access the controlled pawn and then casts it to whatever class you want. I used my NPCchar Class, but you can use whatever you want. Don’t forget to finish the execute or it will never complete the task!

Good luck!