I am trying to rotate an object once it reaches target. I have code inside OnTargetReached(), that will set canMove to false, so that I can set the rotation.
I noticed right away when testing though, that OnTargetReached() is being called by AIPath before the gameObject actually reached it's destination. In other words, if I remove canMove=false from OnTargetReached(), it moves further towards the destination, before stopping.
How do I know when exactly the unity has reached it's destination, and stopped moving? I could check movement speed each update, but that sounds inefficient. Do I need to continually check unit speed after OnTargetReached() has been called?