Search Unity

Reveal different textures

Discussion in 'Shaders' started by kaioa, Sep 15, 2017.

  1. kaioa

    kaioa

    Joined:
    Nov 4, 2016
    Posts:
    6
    I got a great question. Let's say we have 4 different textures assigned to a mesh (default/grey,wood,stone and grass).

    How can I make to have a spherical trigger that, whenever touches the mess, reveals (not painting) one of the different textures, depending on the key Im pressing. It has to change just the zone its collisioning, not the entire mesh at the same time.However, it should stay in that new texture once changed even if its no longer inside the trigger(Like if Id be painting) Thanks!!

     
    Last edited: Sep 15, 2017
  2. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    Set your player world position, radius of your effect, and material mode as global shader properties. Then lerp accordingly in your cubes' shader.
     
  3. kaioa

    kaioa

    Joined:
    Nov 4, 2016
    Posts:
    6
    Could you explain it with a little more detail please ? im kinda noob yet and dont fully understand it, thanks!
     
    Last edited: Sep 15, 2017
  4. kaioa

    kaioa

    Joined:
    Nov 4, 2016
    Posts:
    6
    anyone?