Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Cross Post: Movement Range Display using NavMesh

Discussion in 'Scripting' started by kaercha_unity, Jul 15, 2019.

  1. kaercha_unity

    kaercha_unity

    Joined:
    Aug 8, 2018
    Posts:
    5
    Ive been working on a SRPG for a few weeks now. I have pretty advanced code skills, but limited art skills, so generally I’m coding things and buying assets off the store for my prototype.

    Anyway, I’ve come to a problem I feel should have a pretty standard answer, and yet I can’t find one. I want to be able to display the limits of how far my character can move (maybe even color code the ranges, like “move 30
    Yards, but if you go more than 20 you won’t be able to act afterwards”).

    If you’re trying to visualize it, think of Divinity II. Lots of screen shots out there, they basically look like they use some projector or irregularly shaped mesh from the points that the character can move to to display how far you can go.

    So far, I’ve been using NavMesh to control the movement of my character, and I can get the path and display it, and the path I show is limited to the max range, but I’d like to show like an area around my guys instead of raycasting every update and drawing the renderer.

    I’m close to just picking every point within 360 degrees of my character within the limit, calculating a path to each point (culling path segments beyond move range or the ones that aren’t reachable) then just smashing some borderless translucent shape onto each of those points.

    I feel like there HAS to be a better way, but I can’t find it.
     
  2. kaercha_unity

    kaercha_unity

    Joined:
    Aug 8, 2018
    Posts:
    5
    Bumping. Still trying to solve this.
     
  3. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,946
    I replied in your other post. Next time don't cross-post, its against the rules. Find the relevant forum area and post in that one area please, thanks.