-
|
Hi, I am trying to implement a pause menu to my UI tutorial but could not find how to pause the game entirely. With other engines, you can set game.paused = true or set a timescale value to 0. Could not find the way to do it with Stride. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Best way to create global variable is a your class and register in your system |
Beta Was this translation helpful? Give feedback.
Services.GetService<IGame>().UpdateTime.Factor = 0;- pause,Services.GetService<IGame>().UpdateTime.Factor = 1;- run.this pause method will only work with animations, particles and physics.
If you want use in scrips pause logic for another things, you must have global variable,
bool Pause {get; set;} = false;for example,and do in every Update() and Execute() methods in all scripts
Best way to create global variable is a your class