Create Cylinder Mesh along Terrain Map

Im creating a 3d game with an aerial view where you can click on a character, and a half-transparent mesh cylinder will appear under him (hes at center) and the radius is 50 so it goes out 50 in every direction. This is his max walking distance for the current turn. This works great for flat terrain, but I would like to create a mesh that lines up with the heightmap of the terrain… So like if the cylinder was made of sand/powder and would fall to the exact height of the terrain at every point. Does anyone know how I could do this? Please lead me in the right direction. Thanks

If the ‘50’ distance to move doesn’t care about hills and valleys, I might have an idea for you.
Do you think a projector would work in this situation? It’s not a mesh, and I can’t quite picture your setup in my head, but you can get a projector to put an image on the ground that covers the distance you’re talking about and it would be able to reach whichever height the map is at.

I like the @methos5k idea of a projector… keep in mind you can also use clever Layer control to make the circle only affect the terrain or objects you want it to.

Not only that but you can make the projector orthographic so that the line rays fall like they are colored sand directly to the ground. Give it a whirl. I just tried it out with the Unity Standard assets and it works pretty good against terrain.

I wasn’t sure if the sand/powder was part of the goal or just part of the explanation for matching the height :slight_smile:
Since I wasn’t 100% sure what the OP wanted, I imagined he wanted a visible circle area on the map.

I’m not sure if the standard projector has been upgraded since I last looked, but I know that an additive shader can make it work well for overlay like stuff (I think?:)). I was going to link to that, if I was getting their purpose understood correctly.

1 Like