0
Answered

action stopped after back to it

mo D 2 months ago in Behavior updated 1 month ago 4

Case:

Hello, I'm working on a simple AI behavior, the character will patrol and attack enemy when they can see one. The patrol was working fine as well as the attack behavior. 

After the enemy died, the character does go back to patrol node in the behavior, but It will not move.

I tried to unchecked the "Wait Until Arrived" in the Actions, the patrol action will process and the character will rotate to the markers, but it is still not move at all.

I tried to increase the "wait [x] second", the result is the same as the above.

But it is weird when the character contacts to another enemy, the "Move To Target" and "Attack" behavior will work correctly. The only problem is the "Patrol" behavior.

I really have no cue what caused the problem, please help me, thank you!

Scene:

Actions:

Behavior component:

Behavior tree:

Unity version:
2019.4.1f1
Game Creator version:
1.1.9

Answer

Answer

fixed by using transform from the marker.

But still don't know why the original version only work in the first time.

Answer

fixed by using transform from the marker.

But still don't know why the original version only work in the first time.

Answered

Well, glad you figured out a way to go around this. I'm not sure I see where the problem is as it's very specific to your project. One idea might be that the marker is a bit too high in the air and it's not being picked by the navigation mesh (are you using nav mesh?).

If this problem arises again, do let me know

I have a similar issue with the Patrol action. The character will not restart the Behavior once it has completed the Patrol action. How did you fix it with "transform from the marker"? My patrol action is almost identical to yours, and pretty much copied from the Behavior tip video from Marti. 

Don't use move to marker, change move to transform and use the marker transform