28 – How to Assign Materials Using C# Code in Unity3D



In this video you will learn how to change Matetial of a GameObject through script. Download Script and Materials …

18 Comments

  1. Hi, thank you for this video, could you let me know how to change the material during play mode by clicking and getting a menu to change it…

  2. how to select an object and then apply material after selected from a different option.plz, make a for multiple objects.

  3. I actually designed 2D textures but couldn't find a way to get more than one onto my player. This method allowed me to turn materials into sprites! Pretty freaking awsome :)))

  4. i am looking for a way to change it on touch, IE If object A touches Object C object C gets material A and if Object B touches Object C it gets Material B

    Like QBert

  5. Hmm thanks for the video, but is there a more dynamic way to do this, without predefining every material within the script? I have materials in the directory, can I just reference them directly somehow?

Leave a Reply

© 2023 53GB