Rotate before agentGoto and get finished AgentState

Hello everyone,

I am working on RTS units/group movement via RecastJS, I think it should turn to subdestination(target) first before start moving like a tank would do. Maybe someone knows a better solution to this. Where I am at now, you can view in my PG:

I don’t know if using state-Flag is the correct way?
Starting with the second agentGoto, the pre turning is not executed?

I kinda found an acceptable solution by using initial velocity as threshold:

1 Like