Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Change color at a spesific point at an object

Discussion in 'Getting Started' started by Laur155, Nov 21, 2018.

  1. Laur155

    Laur155

    Joined:
    Mar 2, 2017
    Posts:
    30
    Hello there.
    How can i change color to a spesific point of an object?
    For example i have quad and i wand to make the 1st quarter green.
    Thank you!
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Divide your quad into 2 parts, and change the material color of one of them.

    (Or, learn how to use vertex colors, but that's a much more advanced technique.)
     
  3. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    I think @JoeStrout meant divide into 4 parts, since you want to change a color of a quadrant. He also mentioned using vertex colors and that's a way to do also. It is more advanced but not that difficult.

    There might be a cheater way of doing this, but can be very limited. Create textures for any combination of colors and positions in the square. Then swap the entire texture with the proper texture. You can also create a new texture on the fly using pre-made colored textures, then apply that to your quad.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Well, I was imagining two parts: one that is three quadrants, and one that is the one quadrant you want to change. The OP didn't say they needed to change the color of each quadrant, but just one of them.

    Of course this might be a case of poorly expressing what it is they're really trying to do... but that's a good object lesson in itself. ;)
     
    Bill_Martini likes this.