Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Obi7Beta | Fluid can not work with paused game and UI
#1
Hi, happy to have my first bug report for Obi 7 Gran sonrisa . The problem:
In my UI code, when menu opened, game is paused by setting
Code:
                Time.timeScale = Mathf.Epsilon;

Game is paused, but my UI can still work, I can click button and that button clicked will do some action.
This UI document can work with any scene, but when I open a Fluid scene (sample: ComputeFluids), when play the game and open UI menu, I can move the focus, but cannot click any button. Essentially, the "consume click" event of the UI Document is somehow stopped working?

So, my conclusion is Compute Fluid has some bug with Time.timeScale = Mathf.Epsilon; that will mess up my UI. It is not frozen, just not consume clicks.

Also, I suggest for a feature to pause ObiSolver from updating. Currently I can only disable ObiSolver when I do not want it to update, but by doing so, for example the Fluid, it will disappear. If the Fluid stop updating but still render, it can be neat for a stop time gameplay feature.
Reply
#2
(06-05-2024, 06:12 PM)spikebor Wrote: Hi, happy to have my first bug report for Obi 7 Gran sonrisa . The problem:
In my UI code, when menu opened, game is paused by setting
Code:
                Time.timeScale = Mathf.Epsilon;

Game is paused, but my UI can still work, for example I can move the focus.
This UI document can work with any scene, but when I open a Fluid scene (sample: ComputeFluids), when play the game and open UI menu, the whole UI is frozen, can't click any button, can't move focus.

Hi!

I'm unable to reproduce this: setting Time.timeScale = epsilon (or zero) pauses the simulation, but allows all other systems to continue working (as long as they're not dependent on timescale of course!) This includes UI, just tested it with some uGUI buttons/toggles.

Furthermore, Obi doesn't perform any kind of UI system/event modifications so UI should just work as normal, should be impossible for UI behavior to change as a result of simulation.

(06-05-2024, 06:12 PM)spikebor Wrote: Also, I suggest for a feature to pause ObiSolver from updating. Currently I can only disable ObiSolver when I do not want it to update, but by doing so, for example the Fluid, it will disappear. If the Fluid stop updating but still render, it can be neat for a stop time gameplay feature.

There already exists such a feature: set the solver's MaxStepsPerFrame to zero. No physics steps will be performed, but rendering will still take place.

kind regards,
Reply
#3
(06-05-2024, 06:25 PM)josemendez Wrote: Hi!

I'm unable to reproduce this: setting Time.timeScale = epsilon (or zero) pauses the simulation, but allows all other systems to continue working (as long as they're not dependent on timescale of course!) This includes UI, just tested it with some uGUI buttons/toggles.


There already exists such a feature: set the solver's MaxStepsPerFrame to zero. No physics steps will be performed, but rendering will still take place.

kind regards,

No do not test with uGUI, my problem is with the UI Document (new UI system) .
I've attached a package with a test script, a UI document, a prefab named "Test UI Doc".

To reproduce this issue, you can drag this prefab into the ComputeFluid scene, after the game started 3s, the game will be paused with timescale = epsilon. If you click the Button in that UI doc, the game can be unpaused and timescale is again set to 1. That is the case where there is no bug.

The bug case: game is paused, you click the Button, but nothing happens. The consume click event is somehow blocked.
Link https://drive.google.com/file/d/1IKt6BPF...sp=sharing

Edit! This bug happened because there is an existing event system in the scene. If I delete it, then everything is fine.
Reply