Make AI run when hit

Namadrama

New member
Hi , Im kinda new to this and would love help . Im trying to make enemy change behavior and run when hit ,

1576773205128.png

First Thing I was trying was to send event using collision.gameObject.transform.GetComponentInParent<BehaviorTree>().SendEvent ("event");
but that dosnt work , The Within part of the tree words just fine and stops this event

would appreciate help

Thank you
 
Is the Has Received Event being reevaluated? If the task isn't being reevaluated then that event won't be received by the behavior tree. For a general tree structure I recommend following something similar to this tree:

 
Top