This video covers the OnTriggerEnter() method of Monobehavior, the conditions for it to be called, and how to extract information from triggers detected by Unity during runtime. We also discuss adding a condition to check that you're colliding with the right object.
XRTerra Links:
Programs and Courses: http://www.xrterra.com/programs
Newsletter Signup: https://www.xrterra.com/mailing-list-...
Colliders and Rigidbodies: • Colliders And Rigidbodies in Unity
00:00 What is OnTriggerEnter()
00:28 Scene setup
00:41 Box with isTrigger checked
01:08 Rigidbody component required
01:34 Testing cube gravity and trigger
01:50 Triggers are usually invisible
02:00 Trigger detection script
02:42 void OnTriggerEnter(Collider other){}
02:56 other Collider parameter
03:22 Testing trigger console output
03:40 Rigidbody can go on the trigger
04:27 Setting a tag on an object
05:19 gameObject.CompareTag(string);
06:08 Testing console output
06:42 There can be lots of colliders in your scene
07:02 Outro
Instructor: Gregory Osborne