private void OnTriggerEnter(Collider other) //Detecta una barrera en la parte superior para parar al ascensor { if (other.gameObject.tag == "Sensor") { rb.velocity = Vector3.zero; m.Poner_Bloqueo(); m2.Activar(); } if (other.gameObject.name == "Auxiliar") { m.Activar(); } }
private void OnTriggerExit(Collider other) { if (other.gameObject.name == "FPSControllerOriginal") { m2.Poner_Bloqueo(); m.Activar(); fuenteaudio.clip = portazo; fuenteaudio.Play(); other.gameObject.name = "FPSController"; p.Aparece(); m.Cambiar_Textura(); } }