Hit collider to end the game

hi everyone :wink:

here is the simple condition:

  1. I have a sphere and I create a box collider from empty object
  2. if the sphere hit the box collider, the game is over (show GUI pop-up / something)

Q1: I need the Java script
Q2: if any similar question as mine, link please :slight_smile:

thankyou :smile:

Do you mean something like this?

    void OnTriggerEnter(Collider collider)
    {
        if(collider.gameObject.tag == "myBeautifulSphere")
            Application.Quit();
    }

code for sphere or global setting?

The if-clause is just checking if the tag of Object what collided with the Player equals the string “myBeautifulSphere”.
Of course you can use another tag/string. Don’t forget to assign the tag to the GameObject.

That code would go on an object that is the final objective. You enter that sphere and then the game quits. (substitude myBeautifulSphere with Player)