Created
April 20, 2015 15:51
-
-
Save bricef/9d94c1d9dd7e41c9d7b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class ChangeOnCollision : MonoBehaviour { | |
private Material myMaterial; | |
// Use this for initialization | |
void Start () { | |
myMaterial = GetComponent<Renderer>().material; | |
} | |
void onTriggerEnter(Collider other){ | |
myMaterial.color = Color.red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment