Is there a way to pause the game while not pausing certain things? For example, I have a function where a character can examine something, and I would like time to stop around them so they don't get attacked while examining. However, using Time.timeScale pauses the text crawl for whatever it is they're trying to examine. Also trying to use Time.timeScale affects the inventory UI as well.
@@itsdonix Changing the global game time does not affect Time.unscaledTime. You can safely slow down, speed up or pause everything without worrying that this will affect methods that use Time.unscaledTime.
Can you please make a video on how can we save progress in seen for example in a city builder 2d game how can we same the whole city building and data.
hi, when I click the pause button the menu does not show up but instead says "NotImplementedException: The method or operation is not implemented." Would you know how to fix this? I'm new to coding so I am unsure what to do. Thanks
i stopped game with time.timescale=0; but i cant work this code "Button.interactable=true;" i searched and i probably i need to solve this with time.unscaledTime but how can i do it? help me plz
I changed the pause button to the keyBind esc and when I click on resume, it work but I need to click twice in escape to make pause again, can someone help me please ? I think It's a bit too late but I hope too
There may be a problem with your controls. You can check whether the menu is active or not when you press the Esc key. If the menu is not active, you should put a control like open and close if it is active.
@@SoloGameDev there is no problem when I click on esc, If I click again, the pause menu appear directly. But when I click on resume I have to click twice
after i click exit and return to the main menu scene where i can click play, and i when click play, my game starts at time 0 and cant start the game@@SoloGameDev
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PauseMenu : MonoBehaviour { public GameObject PausePanel; // Update is called once per frame void Update() {
} public void Pause() { PausePanel.SetActive(true); Time.timeScale = 0; } public void Continue() { PausePanel.SetActive(false); Time.timeScale = 1; } }
Short, sweet, and to the point. Thank you
That's so helpful and quick, thank you!
Thank You, Solo Game Dev! I like this tutorial
Thank u this really helped me out with my game!
simple and easy to do. Thanks bro. 1 sub to you.
Thanks man! This is straight to the point! :)
where is the previous video ?
ThankYou buddy
Is there a way to pause the game while not pausing certain things?
For example, I have a function where a character can examine something, and I would like time to stop around them so they don't get attacked while examining. However, using Time.timeScale pauses the text crawl for whatever it is they're trying to examine. Also trying to use Time.timeScale affects the inventory UI as well.
Use Time.unscaledTime for things that need to work during a pause.
@@EmeraldForestCat can u be more specific?
@@itsdonix Changing the global game time does not affect Time.unscaledTime. You can safely slow down, speed up or pause everything without worrying that this will affect methods that use Time.unscaledTime.
@@EmeraldForestCat Thank you for the support. I figured it out myself after awhile but, thanks anyways!
ha no way i just made a pause screen and this came up in my recommended!
😄
Can you please make a video on how can we save progress in seen for example in a city builder 2d game how can we same the whole city building and data.
Thank you
very nice.
Thanks :)
How can I make it so that I have to press esc instead of some button on the screen?
Make an if Statement with "if (Input.GetKeyDown(KeyCode.Escape){}"
And put your desired code(Calling the pause menu) in curly brackets
@@chemax79 thanks
Can I copy the code? Where can ı take it easily?
hi, when I click the pause button the menu does not show up but instead says "NotImplementedException: The method or operation is not implemented." Would you know how to fix this? I'm new to coding so I am unsure what to do. Thanks
i stopped game with time.timescale=0; but i cant work this code "Button.interactable=true;" i searched and i probably i need to solve this with time.unscaledTime but how can i do it? help me plz
You can do it before the game stop if u ask this
@@SoloGameDev ty for answer, my problem was different but it was solved :)
I changed the pause button to the keyBind esc and when I click on resume, it work but I need to click twice in escape to make pause again, can someone help me please ?
I think It's a bit too late but I hope too
There may be a problem with your controls. You can check whether the menu is active or not when you press the Esc key. If the menu is not active, you should put a control like open and close if it is active.
@@SoloGameDev there is no problem when I click on esc, If I click again, the pause menu appear directly. But when I click on resume I have to click twice
how can i make the quit button work???
You can use Application.Quit() command for this.
after i click exit and return to the main menu scene where i can click play, and i when click play, my game starts at time 0 and cant start the game@@SoloGameDev
can someone put the entire C# Script in the comments please?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PauseMenu : MonoBehaviour
{
public GameObject PausePanel;
// Update is called once per frame
void Update()
{
}
public void Pause()
{
PausePanel.SetActive(true);
Time.timeScale = 0;
}
public void Continue()
{
PausePanel.SetActive(false);
Time.timeScale = 1;
}
}
Not helpfull, in a decent project only time = 0 is not enough.