Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement