- Home /
Apply a texture at startup js
Hy.
Beginner here, I was just wondering if somebody knew a way to apply a specific material to a specific GameObject in javascript?
Specifically, I have a number of cubes, all with names, and a number of materials, also known by name. I want to set material 1 to cube 1, material 2 to cube 2 and so on...
Anybody know how to do this?
Also, how to get a specific material from the list of assets.
Answer by Ed unity · Apr 09, 2014 at 07:25 PM
Please review the answer posted on this thread: http://answers.unity3d.com/questions/24096/load-material-to-gameobject.html
It should be what you are looking for, but you will need to edit the code for your specific needs.
Your answer
Follow this Question
Related Questions
Changing material depending on variable 2 Answers
Changing materials with array 0 Answers
How to change value from shader 0 Answers
change a material from multiple materials 1 Answer
Optimize script or Other way get material name (js) 2 Answers