I'm working on a simple, mostly automated RTS.
I'm using a state machine to handle the units, and even though on debug I see that the states are changing correctly in real time, I can't get the units to act accordingly. The game seems to pick one, complete its pathfinding task, and only then moves to another.
If I don't use pathfinding, I use "move to" instead, it works as intended, without the pathfinding of course (MoveTo: Move along Pathfinding path yields the same results as moving with pathfinding)
I didn´t find any solutions on the manual, maybe I´m overlooking something obvious, any help would be appreciated.
the project:
https://drive.google.com/file/d/1K8_Ay0JzGBEGJAj9iMziTP0gxKK5im9V/view?usp=sharing
//DEACTIVATING "FOR EACH" MAKES THEM WORK SIMULTANEOUSLY, BUT THEY APPEAR TO GRAB THE UnitsA.TargetUID VARIABLE FROM ANY UNIT A, NOT THEMSELVES//
+ System: For each UnitsA ===>
----+ UnitsA: State = "idle"
--------+ Sprites_Units: Pick instance with UID UnitsA.SpriteUID
---------> UnitsA: Pathfinding: Stop
---------> Sprites_Units: Set animation to "idle" (play from current frame)
----+ UnitsA: State = "attack"
--------+ Sprites_Units: Pick instance with UID UnitsA.SpriteUID
---------> UnitsA: Pathfinding: Stop
---------> Sprites_Units: Set animation to "attack" (play from current frame)
----+ UnitsA: State = "chase"
--------+ Sprites_Units: Pick instance with UID UnitsA.SpriteUID
---------> Sprites_Units: Set animation to "move" (play from current frame)
--------+ System: Every 0.2 seconds
--------+ UnitsB: Pick instance with UID UnitsA.TargetUID
------------+ (no conditions)
-------------> UnitsA: Pathfinding: Find path to (UnitsB.X, UnitsB.Y)
+ UnitsA: On Pathfinding path found
-> UnitsA: Pathfinding: Move along path