gui box pop up on collision

hi, i want to add a gui box, which contains a choice to play the game again or to quit, to pop up when the player/character collides with a box collider. Mainly im wondering about how to get the box to pop up here. Does anyone know how to do this, and please assist me? I couldnt find it anywhere…

If you want to use the built-in GUI system, getting the menu items to appear at the appropriate time is simply a matter of creating them in OnGUI() when the appropriate conditional is ‘true’ (in this case the conditional is, has the player collided with the box collider?). Remember that the GUI system is immediate mode, which means that controls only exist for a single frame/event, and only when you create them explicitly via the associated functions. So, to ‘create’ a control, you simply begin calling the appropriate ‘control’ function on every call to OnGUI(); to ‘delete’ or ‘remove’ a control, you stop calling the function.

There are other ways to do it as well (that don’t make use of the built-in GUI system), but they’re generally a little more involved.

yes the plan was to use the built in GUI, thank you :slight_smile: