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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to change color?

Discussion in 'General Graphics' started by TheNiceDev, Feb 13, 2016.

  1. TheNiceDev

    TheNiceDev

    Joined:
    Feb 13, 2016
    Posts:
    1
    I'm not sure if this is the correct place to put this but I've had this problem.

    I don't know how to change the colors on 3D objects, I just want a solid color, I looked up the C# codes for making it but all of them seem to be out dated and don't work.

    Help plz?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,245
    The main thing is you need a material (or more specifically a material using the right shader) that takes a color property you can set.
     
  3. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
    1. Find GameObject.
    2. Get Renderer used by the GameObject.
    3. Get Material from the renderer.
    4. Set the color of material.
    Done
     
    Bloker likes this.