i have an enemy setup with a capsule collider and nav mesh agent and follow script as described in the beginner unity tutorial for enemies :
my terrain is not flat, and it’s also not centered around the origin.
whenever i have the mesh turned on, my enemy does head towards the destination as he’s supposed to… but he seems to be walking on imaginary hills. it would look really cool if there was actually a hill there, but there’s not.
here’s a screenshot :
you can see enemy in upper right walking up the invisible hill, then walking back down on otherside. this is exactly what he would do if he was at the origin, but he’s not.
i assume he is walking along the mesh and the mesh is telling him to move that way. i don’t see why the mesh is setup this way, unless it’s assuming the original terrain origin.
i tried adjusting the mesh agent to have the same center as the terrain, but this had no effect.
i also tried to do the same adjustment on the mesh itself, but the mesh has no transform component. i tried switching the nav instantiation to occur after the terrain has it’s coordinate adjusted, but no effect. i also have rebuilt the nav mesh several times, including with and without height maps. again still same behavior.
it seems very simple and i can’t find any posts where anybody is having this problem, so it must be an easy fix.
can anybody tell me what i’m doing wrong?