using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Video; public class Trap : MonoBehaviour { public GameObject bridge; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } private void OnCollisionEnter(Collision collision) { Debug.Log("Enter"); } private void OnCollisionStay(Collision collision) { collision.transform.GetComponent().health -= 1f; //Debug.Log(collision.transform.GetComponent().health); } private void OnCollisionExit(Collision collision) { Debug.Log("Exit"); } private void OnTriggerEnter(Collider other) { GameObject tv = GameObject.Find("TV"); tv.GetComponent().Play(); } private void OnTriggerStay(Collider other) { } private void OnTriggerExit(Collider other) { GameObject tv = GameObject.Find("TV"); tv.GetComponent().Pause(); } }