Skip to content

Instantly share code, notes, and snippets.

@bricef
Created April 20, 2015 15:18
Show Gist options
  • Save bricef/1e5d00df70950b9a531e to your computer and use it in GitHub Desktop.
Save bricef/1e5d00df70950b9a531e to your computer and use it in GitHub Desktop.
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