- Home /
Best way to handle finding a players path?
I am at a point now in my game where I need the enemies to a bit smarter, in my picture below, I have a player who is on an elevated surface. Currently the red line shows where my enemy goes, he will just walk into the wall. I need him to follow the green line up the ramp.
I have tried using unitys Nav Mesh, but I have a good deal of physics calculations going on and its annoying to have to disable/enable NavMesh/Rigidbody everytime I want to calculate them. Plus I would like to be able to knock my enemies off the edge without getting errors relating to them not being on the Nav Mesh.
I have seen A* as well and have not tried implementing it just yet. I was just wondering what would be the best general approach to this situation?
Answer by grimpunch · Nov 04, 2015 at 02:18 PM
I have tried using unitys Nav Mesh, but I have a good deal of physics calculations going on and its annoying to have to disable/enable NavMesh/Rigidbody everytime I want to calculate them. Plus I would like to be able to knock my enemies off the edge without getting errors relating to them not being on the Nav Mesh.
I think this could still be done using Unity's Nav Mesh, I'm at work now so can't run Unity and test this out. But I believe it would be possible to use the navmesh to calculate paths as normal , and disable/remove the navmesh agent component from enemies being knocked off the edge (check for velocity and direction to determine if they are going to land on the world or not) and reenable if needed.
Your answer
Follow this Question
Related Questions
check if an object is reachable 2 Answers
Navigation Mesh not working in build 0 Answers
walking through the countryside ? 1 Answer
Navmesh with destructible obstacles 1 Answer