More than 1 Enemy causes 'TryTakeEnemyAIAction' to be triggered twice

Does anybody else have the same issue?
Any workaorunds?

More Details

So when its the Enemies Turn, the first Unit does two moves.
When logging it is shown that during the first call of TryTakeEnemyAIAction() it seams the Busy state is set to slow…

Logging

Update - State: TakingTurn
UnityEngine.Debug:Log (object)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:36)

Update - State: TakingTurn
UnityEngine.Debug:Log (object)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:36)

TryTakeEnemyAIAction - State: TakingTurn
UnityEngine.Debug:Log (object)
EnemyAI:TryTakeEnemyAIAction (System.Action) (at Assets/Scripts/EnemyAI.cs:89)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:48)

Update - State: TakingTurn
UnityEngine.Debug:Log (object)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:36)

TryTakeEnemyAIAction - State: TakingTurn
UnityEngine.Debug:Log (object)
EnemyAI:TryTakeEnemyAIAction (System.Action) (at Assets/Scripts/EnemyAI.cs:89)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:48)

Update - State: Busy
UnityEngine.Debug:Log (object)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:36)

Update - State: Busy
UnityEngine.Debug:Log (object)
EnemyAI:Update () (at Assets/Scripts/EnemyAI.cs:36)

What exactly is happening? Two units are taking their turn at the same time?
Did you maybe create two EnemyAI objects? There should be only one to manage all the units, not one per unit

2 Likes

Thank you Hugo!
That was excatly my issue.
Stupid me, placed the EnemyAI Script on each Enemy Unit and not on a seperated GameObject :man_facepalming:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms