LoneliNerd
New member
Hi, New to Behavior Designer here, I'm trying to build an "action chain" which will be triggered when some condition is fulfilled. To be specific, what I want to finish is an enemy AI within the steps below.
1. Check if the player inside its detect range
2. if it isn't, do nothing; if it is, rotate to and look at the player direction
3. when the angle between player and enemy is less than some degree, the enemy stops rotating.
4. move backward a little bit like some kind of "warm-up action"
5. rush straight forward.
After making clear of these steps, I tried to build my behavior tree like the picture below.
Every single action logic is fine and works properly, but when I try to build a link between them, a problem appeared. When the player was detected, the enemy will rotate to and finally look at the player's direction, so far is fine. But after that, the enemy will move backward, this action will cause "Player Leave the Detect Range", and once the player leaves the enemy's detect range, the enemy's action will stop, and it confused me, how should I build an "Action chain" which won't break after some condition is fulfill, and the condition will restart checking after the whole "Action chain" is finished.
If there are some better behavior tree building logic advice or some behavior block I should use, please tell me, any help will be appreciated! thanks!
1. Check if the player inside its detect range
2. if it isn't, do nothing; if it is, rotate to and look at the player direction
3. when the angle between player and enemy is less than some degree, the enemy stops rotating.
4. move backward a little bit like some kind of "warm-up action"
5. rush straight forward.
After making clear of these steps, I tried to build my behavior tree like the picture below.
- Check if the player is inside its detect range => If it is, rotate to and look at the player direction until the angle difference is less than a threshold
- Move backward and rush forward for specific seconds respectively
Every single action logic is fine and works properly, but when I try to build a link between them, a problem appeared. When the player was detected, the enemy will rotate to and finally look at the player's direction, so far is fine. But after that, the enemy will move backward, this action will cause "Player Leave the Detect Range", and once the player leaves the enemy's detect range, the enemy's action will stop, and it confused me, how should I build an "Action chain" which won't break after some condition is fulfill, and the condition will restart checking after the whole "Action chain" is finished.
If there are some better behavior tree building logic advice or some behavior block I should use, please tell me, any help will be appreciated! thanks!