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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make Tower defence tower shooting range visible during game

Discussion in 'Scripting' started by Ramunas, Jun 23, 2015.

  1. Ramunas

    Ramunas

    Joined:
    Jun 16, 2015
    Posts:
    4
    I have Tower with circle collider2D and I want to make that circle visible when clicked on tower and while building (that doesn't matter). I need that this visible area would change accordingly to collider.
     
  2. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Tau reikia pasidaryti paprasta permatoma paveiksliuka su apskritimu centre kaip sprite, tada prideti ji kiekvienam bokstui, ir enablinti/disablinti objekta kai reikia rodyti/slepti apskritima, o apskritimo dydis, tai atitinkamai keiti jo scale kiek reikia priklausomai nuo paveiksliuko dydzio, kai keiciasi colliderio spindulys.
     
  3. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    (@startas has responded using Lithuanian the question that @Ramunas asked in English.)

    Translating the answer into English:

    You need to make a simple transparent picture with a circle in the center as a sprite, then add it to each tower, and enablinti / disablinti object when you need to show / hide the circles and circle size accordingly reposition its scale as needed depending on the image size when changing the radius Collider .
     
    malkere and LaneFox like this.
  4. startas

    startas

    Joined:
    Nov 14, 2014
    Posts:
    102
    Don't worry, he should understand what i said, his name is Lithuanian.
     
  5. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    @startas, still this is an english forums and the answer could potentially help others, you know? ;)

    @Graham Dunnett, thanks for the translation. I was wondering if this was a joke...:D
     
  6. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Yes, I know. But lots of Unity users might want to read your answer in English.