- Home /
Question by
littledude194 · Dec 07, 2014 at 11:18 PM ·
texturematerialweaponsswapping
How can I swap an object's texture when I click?
I am making a part of my game so when I fire the gun (clicking the mouse button) it swaps to different textures to make it look like the gun is firing. Do I need code or is it something else?
Comment
Answer by static_cast · Dec 07, 2014 at 11:46 PM
Okay. Make a small plane in front of the gun, and give it a transparent texture. When you apply the texture, you will need to give it a material that allowed for transparency.
Then, through code, you would use Material.SetTexture
to change the texture to a firing texture when you fire the gun.
Once you have done this, you will probably be able to figure out what to do. ;)