Forum rules - please read before posting.

Inventory - Pausing the game & examine actions

Hello,

I'm sorting out the inventory side of my game and have a question about pausing.

I've setup the inventory so when the menu appears the game pauses. This is great. I like this. However, when running an examine on a inventory item it's noticable that the game unpauses in the background. Here's what happens:

This might cause my particular game some problems (because verbs might hit something with the inventory up...etc).

Is there any way, to effectively keep the background game paused AND allow examine actions to take place in the inventory?

Thanks!

Comments

  • You can try unchecking Unfreeze 'pause' Menus? in your ActionList - however, it's likely that won't work because the speech relies on time unpaused to display.

    You'd likely be best off adapting your "flying verb" code to not move when the Inventory menu is on, i.e.:

    Menu inventoryMenu = PlayerMenus.GetMenuWithName ("Inventory");
    if (inventoryMenu.IsOn ())
    {
        // Don't move
    } 
    
  • @ChrisIceBox Yeah, disabling unfreeze was the first thing I tried with no luck. That just prevented the action list from processing.

    You're absolutely right. Into the world of freezing and unfreezing rigidbodies I go!

  • edited February 2019

    @ChrisIceBox Out of interest, when the player closes a menu (such as the inventory) is there any sort of automatic Time.timeScale = 1; happening behind the scenes?

    I'm getting slightly unexpected results when using the method Time.timeScale = 0 to try and pause rigidbody objects which is they are resuming automatically when the inventory closes despite the fact I'm not changing the timeScale from 0.

    The only other thing I do on closing the inventory is run this Action List. Is there anything here that would be impacting Time.timeScale?

    This isn't a serious problem to be clear, the other method of pausing rigidbodies is to set their kinematic property to true which seems to work just fine. :)

  • Yes, AC controls the pause state by affecting Time.timeScale itself.

  • @ChrisIceBox Good to know. Kinematic method it is.

  • edited February 2019

    Success!

    If anyone is ever faced with a similar challenge, because AC uses Time.timescale, I found the best method to pause the movement of rigidbodies was to set .IsKinematic = true on inventory open, and then revert back to false on closing the inventory.

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.