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

Change material values of Unity 5 using C#

Discussion in 'Scripting' started by MaxGaniyev, Jul 6, 2015.

  1. MaxGaniyev

    MaxGaniyev

    Joined:
    Mar 18, 2010
    Posts:
    29
    Hi everyone,

    How can I change Metallic, Normal or Emission value through scripting in new Unity 5's Material system?

    Thanks,
    Max
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. MaxGaniyev

    MaxGaniyev

    Joined:
    Mar 18, 2010
    Posts:
    29
    Thanks for your reply! This method works for legacy shaders, but not working on Unity 5's PBR Materials.
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148