Physics and GUI Events
Explore the key physics events like collisions and triggers, and understand GUI event handling in Unity. This lesson equips you with scripting skills to detect collisions, apply impulses, control triggers, and display graphical user interfaces. By learning these concepts, you will be able to enhance realism and interactivity in your VR projects on Meta Quest 2.
We'll cover the following...
We'll cover the following...
Physics events
Collisions reported by the physics engine come under the umbrella of physics events. The events responsible for detecting changes to such a collision are OnCollisionEnter, OnCollisionStay, and OnCollisionExit. For Colliders that have the “Is Trigger” property turned on, the equivalent events for them are OnTriggerEnter, OnTriggerStay, and OnTriggerExit.