Created
April 20, 2015 15:18
-
-
Save bricef/1e5d00df70950b9a531e 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; | |
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