Search Unity

Highlight an Area on Terrain

Discussion in 'Scripting' started by Dezeris85, Dec 4, 2019.

  1. Dezeris85

    Dezeris85

    Joined:
    Dec 16, 2016
    Posts:
    24
    Hey guys I've been looking all day for a place to launch off from for this. So far, no luck... And now I'm here. hopefully someone can point me in the right direction. What I'm trying to do is click on the terrain and highlight an area. First thought maybe projector but i need to highlight a large area and drag to make it bigger, kinda like a paint brush. Then thought maybe get the texture from the terrain and just recolor those exact pixels temporary and then switch back when I'm done. But haven't really figured that route out either. this is mostly for visual purposes in a editor i created. One of those not needed but be nice things.
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    You may be looking for something similar to this, so it may help:
     
  3. Dezeris85

    Dezeris85

    Joined:
    Dec 16, 2016
    Posts:
    24
    That's pretty much what I want sorta but still dont see how i can have it grow when I drag the mouse.
     
  4. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    I didnt look through his implementation, but at the start he shows how he can increase the size. So you would just do something like that via script, when you detect a mousedrag. Am i missing something?
     
    Joe-Censored likes this.
  5. Dezeris85

    Dezeris85

    Joined:
    Dec 16, 2016
    Posts:
    24
    It increases the radius in his example which does increase the area but I wanted to drag like a paint brush so the area gets elongated not grow in radius.