- Home /
Non-player movement
Okay, here is what I'm trying to do -- I'm creating a number of 3D game objects and having NPCs walk on top of them. This would be straightforward if the objects were all flat, but they have varying elevation. I also need to use pathfinding for all this. I've read over the docs, but am still not really sure of what approach to use.
Now, I have a few questions related to this --
What is the best approach for making sure the NPC follows the elevation of the terrain they're standing on? I was thinking of using a raycast and just getting the height of the object immediately below the NPC.
Does using navmesh make this redundant -- in other words, does navigation mean that an object is going to follow the terrain height?
If the answer to #2 is no, would having a function to check height under the NPC interfere with pathfinding?
Is there a better way of doing this than what I'm thinking? I don't think I need any kind of physics functionality outside of a mesh collider on the NPCs to handle their other game functionality.
Thanks!
Answer by Steffen D E · Dec 29, 2014 at 11:03 AM
I havn't worked with navmeshes myself, so not sure I can answer your questions, but would advice to have a look at this: http://unity3d.com/learn/tutorials/modules/beginner/navigation/navigation-overview
and look through five the tutorials.