Search Unity

Сhange the material

Discussion in 'General Graphics' started by DanZ91, Dec 13, 2017.

  1. DanZ91

    DanZ91

    Joined:
    Sep 29, 2016
    Posts:
    6
    Good afternoon. How to change the material only at the part of the object that is in the trigger?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    You'd need a custom shader to do this, and a script that passes a trigger's collision shape to a material. Alternatively if this is 2D you might be able to do it with masks and drawing two sprites, one for in and out of the trigger.