/* * This file is part of the "House of the Future" showcase project by M2H (http://www.M2H.nl) * The original author of this code Mike Hergaarden. * Feel free to use this code for your own projects, drop me a line if you made something exciting! */ //Simple "culling" to en/disable the webcam when in range function OnTriggerEnter (other : Collider) { if(other.transform.tag=="MainCamera"){ transform.parent.gameObject.SendMessage("ActivateCamera"); } } function OnTriggerExit (other : Collider) { if(other.transform.tag=="MainCamera"){ transform.parent.gameObject.SendMessage("DisableCamera"); } }