So, I’m creating this game where you fight against giants. The giants are moved by navMeshAgents and they use a RayCast to check there’s nothing in between them and the player (like walls and such) to enable and disable the navMesh. The problem is that if a giant is following a player and that player goes behind a wall the giant will stop immediately, looking unnatural. I want to get the position the player had when it hid from the giant so the giant can go up to that last position and stop there, looking a bit more natural. Thank you in advance ![]()
There are many ways you can do this. I recommend watching this unity stealth game video tutorial. In this tutorial they exactly talk about what you want to do for the last player sighting. In this enemy ai tutorial they show how to use the last player sighting in the previous tutorial to move the enemies. These tutorials might even give you other ideas for your game. Hope this helps!