Friday, November 2, 2012

Unity how to change texture for game object using script

Here is the easy way

var myTexture : Texture;

gameObject.renderer.material.mainTexture= myTexture;



step by step how to do it in scrip
1. Create a new java script on your Unity
2. Paste in the code
3. Drag your script into one of your gameObject
4. Drag the texture you like into your gameObject variable myTexture


No comments:

Post a Comment