Shamba

material

Mar 16th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Material_changer : MonoBehaviour {
  6.  
  7.     public Material changemat;
  8.  
  9.     private void OnTriggerEnter(Collider other)
  10.     {
  11.         if(other.gameObject.tag == "Player")
  12.         {
  13.             CubeMovement.mat = changemat;
  14.             other.GetComponent<MeshRenderer>().material = changemat;
  15.         }
  16.     }
  17. }
Add Comment
Please, Sign In to add comment