i wanna create seperate level for my pause menu, is it okay to do that? does it cause any performance problems?
and there would be a problem that, when i pressed resume button, my current level starts from scratch
If it’s just menus, you can just use widgets. Why use a separate level?
because of the pause menu music stuffs. I handled it with casting on my pause_menu to player character. I can’t find any other efficient way to do that. I used casting, because pause_menu input action controls the music with flip-flop. I added custom event there to stop music and close the widget. I used that custom event on my pause_menu widget to stop music, when user clicks on resume as well. if I didn’t do it like that, pause menu music will never stop. Do you have any other recommendations?
You can totally load a pause menu ( and other menus ) with music, without the need for separate levels
The menu can play the music when it loads.
i agree with you, but it cause another problem too. There is seperate options_menu, when i press options button to open options menu widget, music stops
I think this could be solved by using a widget switcher, if you call the music to play under a parent “pause menu” widget, and use a switcher to switch between the pause menu and options screen your music should continue just fine
all right, i will look to that and say my experiences here
I have done thing you want to do.
However for different reasons than you (i want some nice menu background).
I used data layers for switching/loading in TINY background level.
So I made black box covered with black unlit material to block all light from real level.
Then i made my background level into packed level (it is just blueprint created out of level parts, but you can create it semi automatically now in unreal).
So having that packaged level as blueprint and on separate data layer, makes everything very easy.
Just pondering how to snap camera inside it, either new Menu pawn and posses/ unposses, or i add code to current pawn that switches camera.
I usually have the music system in a game instance, you can create an interface to send instructions to it, from anywhere in the game.
this also sound good, I will look into that as well
i tried widget switcher and apply it, thanks for your suggestion. Unfortunately, I still have to use casting on my widget, but i am trying to avoid
Dont play music in the level. Play it in the GameInstance, then you can manage start and stop, as well as pause menu music. Put your music in a CUE so that you can loop it during the level.
As the game instance travels levels (map) your music doesn’t stop when you change map.