Search Unity

Changing the color on a partial area of an object

Discussion in 'Scripting' started by unwitty, Feb 4, 2015.

  1. unwitty

    unwitty

    Joined:
    Jan 18, 2015
    Posts:
    31
    Hi,

    I want to create an object that has a portion of its surface heat up (i.e. change color) after being shot at. The color change is gradual and only applies to the surrounding surface area of where the shot hits the object.

    My current implementation uses renderer.material.color and color.lerp to change the entire object's color. However, I need to only change the color of a particular partial surface area.

    Could you give me some tips on how to do this? Thanks.
     
  2. tobyheadcast

    tobyheadcast

    Joined:
    Aug 5, 2014
    Posts:
    25
    Break the object up into sub components? Use a decal system ?