Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

color changing script

Discussion in 'Editor & General Support' started by punkysmurf, Dec 9, 2010.

  1. punkysmurf

    punkysmurf

    Joined:
    Dec 5, 2010
    Posts:
    5
    I have a character, when he gets angry I wanted to make him turn red.
    Does anyone know the way I can use a script to access that characters mesh color and change it to red?
     
  2. enragedmrt

    enragedmrt

    Joined:
    Oct 5, 2009
    Posts:
    95
    Well, if you are using a material with a color property, then it's

    transform.renderer.material.color = Color.red;
     
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    No need for that.