Quantcast
Channel: Answers by "Kleptomaniac"
Viewing all articles
Browse latest Browse all 90

Answer by Kleptomaniac

$
0
0
Here's how. Just use an array of materials and cycle through them with each successive mouse click. Then apply your newly chosen material to your mesh and your good! So like this: var matArray : Material[]; private var index : int; function Update () { if (Input.GetButtonDown("Fire1")) { index++; index = index % matArray.Length; renderer.material = matArray[index]; } } Add your materials to matArray and ensure this script is attached to the mesh you want to affect. :) Hope that helps, Klep

Viewing all articles
Browse latest Browse all 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>