Advertisement
Guest User

Untitled

a guest
May 29th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ChangeOnCollision : MonoBehaviour {
  5.  
  6. private Material myMaterial;
  7.  
  8. void Start () {
  9. myMaterial = GetComponent<Renderer>().material;
  10. }
  11.  
  12. void onTriggerEnter(Collider other){
  13. myMaterial.color = Color.red;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement