Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Proper way(s) to show turret attack range for TD types of game

Discussion in 'Getting Started' started by narf03, Oct 23, 2016.

  1. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    222
    I am wondering how can i show turret attack range(s) for TD type of game, lets say im using unity terrain, and on a map something like this(not mine, just randomly pick from google image).



    Lets say the turret i want to show range has minimum and maximum range, means if turrets get into minimum range or further than maximum range, then it cant attack.
     
  2. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
    Can you use a tinted ring that lies on the terrain when you have the turret selected? Players are pretty used to seeing the range highlighted in some way.
     
  3. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    222
    1) How do I draw on terrain?
    2) Since the terrain not flat, or 2d, i need a proper way to calculate/draw the area, like i have a sphere, overlaps with the terrain, then change the color of terrain that overlaps.
     
  4. Deleted User

    Deleted User

    Guest

    You should use Projectors. While a shader-based solution would probably be better (the material of the ground would draw a circle on itself based on some info you send it) I bet you can get practical results out of just projecting a circle onto the ground.
     
  5. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    222
    Did considered that, but it wont work correctly, imagine i place the tower on a mountain, it will draw a circle, but if the mountain is raised, the circle becomes bigger, it should be smaller. I want sphere type of range indicator, but the projector do top down cone type.
     
  6. Deleted User

    Deleted User

    Guest

    At some point as a beginner it makes sense to limit the scope of your project to match your technical capabilities. Still, I have more ideas for you.

    Why not just attach a very large transparent cylinder that clips through the ground? Visible only when selecting a tower, of course.
     
  7. narf03

    narf03

    Joined:
    Aug 11, 2014
    Posts:
    222
    Actually im not doing anything, im a programmer, as long as the logic works in my brain i should be able to make it work via coding, so now im trying to understand the logic, should not limit the scope at this stage.

    Did consider cylinder, but not pro.