- Home /
Dynamically Changing the texture of an object
While I know how to change the texture of an object I need to change it based on information that is dynamically read into the game. For example a request is made to a server for the texture that is to be used on said object. So I have the name of the texture and the object that I want to put the texture on.
Ideally I would like to be able to have a variable that can pass the name of the texture, but I have not found anything that will do the trick. Any help would be appreciated.
That's great and all but it only works if you know which texture you want to use while scripting. Since it needs to be done dynamically, I won't know the name of the texture until runtime.
Answer by testure · Jun 30, 2011 at 03:35 AM
material.SetTexture()
http://unity3d.com/support/documentation/ScriptReference/Material.SetTexture.html
Your answer
Follow this Question
Related Questions
Dynamically changing _part_ of a texture 2 Answers
Dynamically changing part of a texture v2 1 Answer
Dynamic Material & Textures 1 Answer
Dynamically loading textures to avoid memory problems 1 Answer
Random place changement 2 Answers