- Home /
About Slider and pause,About Slider and Pause
I made a hp bar and pause button.
Then i used this script to pause button.
public void OnClickIsPause()
{
ispause = !ispause;
if(ispause)
{
Time.timeScale = 0f;
}else
{
Time.timeScale = 1f;
}
Time.fixedDeltaTime = 0.02f * Time.timeScale;
}
Then, After I clicked PasueButton, All things stopped.
But hpbar was changed when i press w, s, UpArrow, DownArrow.
Although I never used w, s when i make script.
I found the soultion from https://answers.unity.com/questions/1436116/weird-ui-slider-behaviour.html
But I have a question.
Hpbar was changed by w, s, UpArrow, DownArrow only after I clicked PauseButton.
Before I click PauseButton, hpbar never changed by w, s, UpArrow, DownArrow.
i don't know why... my script for pause button is wrong?
Thank you for reading.
Your answer
Follow this Question
Related Questions
Pause and resume coroutine 0 Answers
Pause Game 1 Answer
Pausing the game after player object gets destroyed 1 Answer
Android service plugin with OnApplicationPause issue 0 Answers
Game won't unpause after pausing 1 Answer