Think I have gotten more into it but still got some things i get stuck on
So the problem is the following.
1.)I teleport my unit (like on the picture below
2.) He should not be able to pass through the door (i call seeker.CancelCurrentPathRequest()
3.) I want the unit to ROTATE only towards the door.
I have tried the below code but this just moves unit a “lil” towards the position but doesn’t rotate him (which is kinda expected behavior as canMove disables all type of movements and i guess it takes him some time to realise that moving is disabled, like a frame)
Tried (GetComponent().updatePosition = false; instead of canMove) just for test and this does disable movement but, unit rotates towards the door fully and then rotates back to original direction? Can i make him stay oriented
Is there some better way that I am missing? (most probably since this doesn’t seem right)
ThisIAstarAi.canMove = false; Vector3 nextPosition; Quaternion nextRotation; // Calculate how the AI wants to move ThisIAstarAi.MovementUpdate(Time.deltaTime, out nextPosition, out nextRotation); // Modify nextPosition and nextRotation in any way you wish // Actually move the AI ThisIAstarAi.FinalizeMovement(nextPosition, nextRotation);
P.S. Just to reiterate, I have everything solved when unit is moving TOWARDS the door from at least 1 tile away (as it will be facing the door once it walks in on the tile), the problem is when i use teleport, as the unit is on that same tile as the door and is facing opposite direction i am not sure how to turn him towards the doors. (i could obviously rotate him myself but would like to do it through the system so everything is consistent)