Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im trying to implement point and click movement in my game, but at the moment im stumped about how i can select parts of a mesh for the player to walk to.

So what ive done is ive got a navigational mesh in my game, i can select points from it, but what i want to do is be able to select the navigational mesh in real time and be able to tell the player where to go on the navigational Mesh, how can i achieve this?

I thought triangle-picking might be one way to determine where im selecting the mesh with mouse unproject but i think i need a bit more accuracy than that, no?

How can i achieve point and click on a navigational mesh in real time?

Thanks

share|improve this question

1 Answer

In theory your navigation mesh should be fairly sparse with a few big triangles. Ray/triangle intersection is also fairly fast if you don't have many triangles. The best approach is likely to simply fire a ray from the camera through the cursor and see if it intersects any of the triangles from your nav-mesh, and if so, tell the player to move there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.