Material instance unwanted
Hello. This new question of mine is regarding materials and material instances. In my game I have a script that creates a raycast to see if there's an item around. When there is one it picks it up in makes the first slot available in the inventory occupied with that item by changing it's material. Then, in the slot, if the material is the one owned by the HK416 (hk416.mat) then the boolean HK416 equals true. And when it is true, if the slot gets clicked the rifle is equipped. But then, instead, this happens. (see the image)
What I want is to not have it be an instance. By the way, the material is referenced in a variable on the item before being picked up.
Answer by AlphaGarg8447 · Dec 06, 2015 at 08:32 PM
Done. All I did was instead of getting the renderer.material and setting that as thisMat, I got the .sharedMaterial, and that made it get the origin of the instance. Now it works perfectly.