Author Topic: UI sometimes unresponsive after timescale set to zero  (Read 16548 times)

mukulabdagiri

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 11
    • View Profile
UI sometimes unresponsive after timescale set to zero
« on: February 17, 2017, 02:28:20 PM »
Hello,

I am setting Time.Timescale to 0 to pause my Unity game. On pause i show my pause screen made with NGUI, user can navigate through pause menu and it all works fine. However, once in a while when i pause, it freezes everything including my NGUI pause screen and i am unable to navigate through the menu. I have to force close the application.
Do i have to make any specific changes in code to make sure my NGUI screen is responsive even after timescale is set to 0?

Thanks,
Mukul

mukulabdagiri

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: UI sometimes unresponsive after timescale set to zero
« Reply #1 on: February 18, 2017, 12:27:40 AM »
I forgot to mention that I am running the game on PS4.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI sometimes unresponsive after timescale set to zero
« Reply #2 on: February 18, 2017, 07:33:09 PM »
NGUI relies on physics to be functional -- that means colliders. If the game is entirely paused with timescale of 0, then moving colliders may have no effect, and as such it may not be possible to interact with the UI elements. You can try to delay your time freezing operation until after the next Fixed Update after showing your UI, that will most definitely ensure that the UI can be interacted with. That said though, PS4 implies controller-based input, which isn't affected by timescale. Unless you treat your controller as a mouse?

mukulabdagiri

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: UI sometimes unresponsive after timescale set to zero
« Reply #3 on: February 19, 2017, 02:11:51 AM »
No, I am using controller based input. I will try delaying the freeze.