Close game on 3D collision

I’m new to Unity and need to know 3d collision. I need the game to close when the player touches a 3d object

  1. Add a collider and a rigidbody component to both the player and the 3d object

  2. Check the “IsTrigger” on the player collider but uncheck it in the 3d object collider

  3. On the player, add a new script and add this code

void OnTriggerEnter(Collider collide) { Application.Quit() }