How to hide level from blueprint?

Hi!

I’m trying to develop a pause menu system for vr (i have the HTC Vive) and wondering what is the best way to
develop a vr pause menu system that look like below in the attached picture (screenshot from Dead Secret).

Basically what i want is if i push the menu button on the motion controller the level gets frozen and also dissappears from sight, and a similar screen appears as in the included image with dark background, where you can navigate between the inventory items, documents etc.

But the question is how to hide the level and show this pause menu screen with blueprints??

(Should i create the pause menu as a different level?)

Any ideas? Thanks in advance!

Well, I came across this post while trying to do the exact same thing, also for my VR game.

The Ideal Solution:

Load your map’s GamePlay/Geometry in as a sub-level. Then also add your Menu map to the Streaming Levels list for that persistent world. You can now use the GetStreamingLevel node in Blueprints to get your levels by name. Then you can call SetIsVisible on them to enable and disable their visibility.

204404-ue4editor_2017-08-14_22-54-46.png

But my maps are already persistent!

I investigated changing the visibility of the Persistent Level. Do not do this. It is technically possible via C++ code

GetWorld()->PersistentLevel->bIsVisible = false;

However, when you make the Persistent Level no longer visible, all of the actors inside of the level stop rendering and stop ticking. This means your GameMode, Player Controller, all stop. It also seems to stop submitting frames to the viewport as the change was not visible in the viewport, but was in the World Outliner.

The other solution:

I have not tested this, but this is probably the solution I will choose:

Spawn your menu map as a sub level. Then make sure it’s far below your normal game maps (so they can never see it if it’s visible). Take a box and turn it inside out and put that in your Menu Map - now you can’t see your main map.

When you open the menu, either teleport your pawn to the Menu Map and when you close your menu teleport your player back, or, have two copies of their pawn. One in the Menu and one in the world, and change who they possess when you open the menu.

1 Like

Can anyone help me please? : /

Hi! Thanks for your reply!

I will try out what you said, especially like the teleport idea! :smiley:

Glad to see that others have the same problem to figure out how this works, it’s tricky.

I just want to add, that if you look for ‘setisvisible’ there will not be any node under that name that can effect the visibility of a level. make sure you type ‘should be visible’

Is this only working for objects that are already in the streaming sublevel?
I spawn an object at runtime and it wont hide with this methode…