Forum rules - please read before posting.

Pause Menu not affecting the menu animation

Currently if I set a pause menu (selecting Pause game when enable) it pauses everything, also the menu animations.

If I use a menu (from Unity UI) with an animation I'd like to let the animation play, but pause everything else.

Comments

  • I second this. Just ran into this being an issue for myself as well. I would prefer that game pauses do not affect menu custom animation in unity ui whether its transitioning in or out.
  • I third this. This has been on my mind for a while now but I've forgotten to bring it up since it hasn't been critical for me, so I'm glad you did.
  • edited January 2015
    I'm not able to see a way around this.  When the game pauses, it zeros the timescale - so that absolutely all gameplay (including animations) is frozen.  While it may be that this also freezes unwanted animations like the UI, it does at least ensure that the game itself will never advance.

    I'm happy to take suggestions, however.
  • edited January 2015
    Uhm.

    Maybe an option is to make everything "non-interactable", disable all character movements and read only the mouse clicks on the menus?

    There should also be something to paralyze the animation on the characters.

    For the Action Pause Game maybe you could disable them temporarily and start counting when game goes back online?

    Something like:
    - IgnoreAllRayCastExecptMenu();
    - ParalyzeAllAnimations();
    - StopCountingMenuPause();

    BTW, it's not a big issue, but it would be cool to have it if it's not too complicated. 
    It is not critical for me too.
  • edited February 2015
    If you are using "time.timeScale = 0" for pause, then this must help:
    Choose button/canvas/etc that you need -> Animator -> Update Mode -> Unscaled Time

  • Thanks! That helps a lot! Now I just need to figure out how to do the same for the PA particle fields asset...

    By the way, for anyone interested, I haven't tried it yet, but supposedly this works for regular particles (attach to game object which contains the emitter):

    void Update()
         {
             if (Time.timeScale < 0.01f)
             {
                 particleSystem.Simulate(Time.unscaledDeltaTime, true, false);
             }
         }
  • I had this problem. Switched to not pause on showing a menu.

    Now, I'm manually control the menus (hide/unhide) when pause pressed. Works well, but naturally more setup initially.
  • edited September 2016
    I've been trying to solve this problem for a while, and it's a bit complicated because the UnityUI/menu is very very business critical and needs to be available at any time (except cutscenes). This store also has lots of textual content and relies on AC menu translations.

    Business critical in this case means that it's the "store", which contains everything our game sells as IAP. It needs to be easily accessible and user friendly, everyting in this one complex fullscreen canvas. 

    The store also depends on multiple external assets for integrating IAP into various stores. I don't really have 100% control about the implementation of these assets and they seem to rely on the timeScale at least when connecting to some external store APIs. Hacking them to not use timeScale would make upgrades dangerous.

    The store works otherwise ok in pause mode, except when a transaction is activated, nothing happens (or actually, the game becomes unresponsive because of an transaction related additional canvas without anything clickable comes over everything). 

    So, I need to keep timeScale running. Should it be ok to let the game run in the background behind the canvas? It could work If the game doesnt respond to any clicks which are meant for the store canvas, and characters/hotspots etc dont interact/advance in any way. I did try to disable some engine functions temporarily with Actionlist Engine : Change systems, but encountered some weird behaviour, so need an alternative approach.


    In short my question to @ChrisIceBox is if this would be a safe approach:

    1) AC opens the UnityUI menu turn on the fullscreen store, game being non-paused
    2) Disable AC fully with 
    AC.StateHandler.SetACState(false);
    3) Let user buy stuff (with timeScale NOT at 0)
    4) Let user click on our the store Close button which resumes Control to AC
    AC.StateHandler.SetACState(true);
    5) Close menu (with AC ActionList), and thus resume normal gameplay

    Is this a good approach?

    I'm assuming I don't need to call this also, or do I?
      AC.StateHandler.RestoreLastNonPausedState(); 


  • If the UI relies on other assets and systems outside of AC, I would recommend leaving AC out of it completely if you can, and enable it when needed through a custom Action.

    If you want to disable AC completely, you'll want to use the KickStarter functions instead of the StateHandler's, as shown on the front page of the scripting guide:

    AC.KickStarter.TurnOffAC ();
    AC.KickStarter.TurnOnAC ();

    When using those functions, AC will handle all else, including the game state and active dialogue, etc.  However if you want to make use of things like variables when your IAPS are purchased etc, I'd recommend disabling the individual systems instead.

    You'll have to elaborate on "wierd behaviour", but generally know that this Action will basically cease update calls to each system - so currently-running speech, moving characters etc will also have to be forced off with other Actions as well.
  • Thank you very much @ChrisIceBox :)
    Currently I got the store working even without turning AC completely off, but I still may use it.

    "You'll have to elaborate on "wierd behaviour".."
    Earlier the store seemed somewhat unstable while using that action. There were problems like existing menus / hotspots being triggered by touch events even if they were in the background - if the game was not paused. Currently I can't reproduce them by using the engine : change systems action (and there have been several AC version upgrades since).

    The InGame-menu still lingers visible over the store more or less. It wants to stay enabled whenever to Store is active, even if it is turned of in the actionlist that is run when Store-UI is activated. Maybe because opening the store happens during Pause menu (when game is paused), but the Store UI makes the game unpaused, while also disabling most systems, making the game kind of paused.

    I guess InGame-menu is auto-activated whenever the game is running, and this happens right after I've disabled/hidden it with an actionlist. Luckily there are more ways to manipulate that menu to really hide itself. 

    Anyway, I'm not stuck with this problem anymore, so thanks Chris :)
  • edited May 2018
    Following this issue, is it possible instead of pausing the gameplay to block all interactions in game behind the menu? Per example Walk click or hotspot interactions? I tried to create a panel on Behind Menu UI to block raycasts but didn't work...

    P.S. OK I solved this by using AC.StateHandler does pretty much the same job :D so nevermind


  • The Interaction system can be disabled at any time with the Engine: Manage systems Action.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.