0
\$\begingroup\$

In my game, If i click on terrain my soldier goes there. In my terrain there is no place without a navmesh. So, I want to make area where player moves his soldiers on it. If he clicks outside this area, soldier will not move there or moves to closest point inside the area to this outside. Could invisible wall do this ? Image.Image2. update: To solve this, make any object fit your area. then, use mouse to detect that object.

\$\endgroup\$
  • \$\begingroup\$ What defines the shape of the area the characters are allowed to move within? Is it a circle of some radius or union of circles, a polygon or mesh thereof, a vector shape bounded by a spline, an image mask, or some other way of describing a shape? Can it change at runtime or is it fixed at build time? \$\endgroup\$ – DMGregory Jun 30 '18 at 18:09
  • \$\begingroup\$ Any shape. let us take circle. and will not change through the game. I'm not sure if this will work or not. If there is any thing else better than this idea, please write it. \$\endgroup\$ – Omer Jun 30 '18 at 18:52
  • 2
    \$\begingroup\$ When you found a solution yourself, then you should post an answer to your own question and accept it. That way people can see that your question was answered. People can also upvote your answer. Answering your own questions is encouraged on Stackexchange. \$\endgroup\$ – Philipp Jul 3 '18 at 17:00
  • \$\begingroup\$ Sorry for that. I'm still new here. \$\endgroup\$ – Omer Jul 3 '18 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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