From game to ingame menu and back, how to

Hi all,

I have a scene running and I want to show a menu when the player presses a button, this menu will cover all screen and player won’t be playing while in it (it is a menu to setup things like weapons, etc…). This should be done in some steps:

  1. Game must pause because we don’t want our enemies to be hitting us while we’re in the ingame menu.
  2. We must disable rendering of all meshes, etc… to make things smoother when running the menu.
  3. We will show the menu in camera space.

This leads me to a solution…

Have all ingame objects/meshes, etc… under a “root” game object to deadtivate all the branch at once using the DisableRecusrively function. Add menu to scene, do things, remove menu and reenable all objects under the root node…

Is there a better solution?

Thanks in advance,
HexDump.

Well, to solve 2 and 3 you could always set up your menu view on a separate camera from your game view, and then just switch cameras to display the menu or the game view.

Then you’d just need code to pause/disable the game view objects.

Hi,

Yes for second and three what you stated is a pretty good option. For first one I think there’s no other way to do it, anyway, if anyone knows another way to do it I would be really greateful if he could share it.

Thanks in advance,
HexDump.

In a game that I recently created I have my own internal time scale value separate from the game’s time scale. I have this because my game has different simulation speeds; you cannot modify the game’s time scale to change simulation speeds because then animation in menus (for example) also change. So I had to have my own time scale. Anything that I am moving and controlling in the game use this time scale (and are notified with messaging when it changes) so that they can adjust appropriately.

In your case, perhaps having your own time scale value would work too. 0 would be pause, 1 would be normal. Anything in your game that moves or shoots or whatever needs to be notified somehow that your time scale value changed so that they either pause or continue with what they were doing.

This is an architectural thing, though, so depending on how deeply your game has been developed and how much schedule you have left may not make this methodology trivial.