how to keep reciveing event

evenmov

New member
such as a rts game , i right click the enemy ,and send attack event to my army
but it will keep working until finish the task or i can not receive new event , how to keep HAS RECEIVE EVENT working all the time ? when it first receive a event , the task become finished and will not receive new event
 
i tied this code to restart the tree

Code:
                                    b.DisableBehavior(false);//Stop Last BT
                                    b.EnableBehavior();
                                    b.SetVariableValue("Targets", targets);
                                    b.SendEvent<object>("Command", "Attack");

but when it restart it can not get the event ...
 
HasReceivedEvent will always receive the event, it just may not be reevaluated allowing you to capture that event. You should ensure the task is being reevaluated with a conditional abort.
 
Top