My favorite Unity channel, everything is very clear and straight to the point. Could you possibly make tutorials about UI? Rect transform UI components in Unity and how to use them How you setup your UI maybe even instantiating UI because controlling UI from script is quite different from normal objects. Thank you for the amazing tips and tutorials!
Really great tutorials, I'm all caught up now and checking out some of your other stuff. Cant wait to see where you take this, this truly is one of the better tutorials out there!
Nice tuts! I hope next you do how to make the same character transfer between levels/maps/scenes like for example the character goes into a portal, the map will change to indicate that the character have traveled through the portal.
This is probably a good simple way to do it for small scale projects, but more main stream ones. It's best to use a scriptable object that can be read from any script, and check within the scripts themselves. This provides full control. Wrap all your inputs with a bool check except for the pause input.
Hi, thanks for suggesting an alternative solution. Do you use the scriptable object just to stop input and still use timescale zero to pause animations, tree sway etc?
@@KetraGames it all depends, using the SO to set the value allows for full control. It allows you to pause or unpause certain elements of state machines, you can use it to turn off processes in shaders that are not bound by time scale. And if you do want an unscaled object to be paused under very specific situations, you can do it that way too. you can go as far as making an enum into a scriptable object and development different paused states / levels. Each level creating a different amount of influence depending on the need.
@@KetraGames In general, getting people more familiar with SO's, even if it's something as small as a pause value in a tutorial, will benefit them in the long run. Especially since Unity is pushing heavily for SO's to be their main form of serialization.
would it be possible to make an IPausable interface that anything you want to be paused could be haulted in their update? or would a C# interface not allow you to make that check? just thinking about having to go through everything in the game that may want to have a pause feature, and my brain would probably forget some of them unless i planned in advance. Or maybe a base class? or are neither of those a possibility?
Hi, good idea. You could create an empty interface that you assign to all scripts you want to pause. Then you could disable any scripts with this interface to stop the update method being called. Hope that helps 😊
@@KetraGames awesome!! i had some strict coworkers that really pushed me on that stuff. it's encouraging to see that some of that stuck with me. do you get into inheritance some with unity, or does that conflict with unity's component based architecture?
@@stevethepirate Inheritance isn't something that I tend to use much, but it can work in Unity. I'd advise to use it sparingly though. I'm sure you know this, but it's generally better to favour composition over inheritance, which Unity's component based architecture is geared toward.
Hi, to unlock the cursor when paused write a script with a method that sets the cursor lockstate to none - Cursor.lockState = CursorLockMode.None. Then you can hook up the Unity event to call this method when the game is paused. You would also need to do the opposite when the game resumes. Hope that helps 😊
I didn't follow all of the last 30 seconds or so of this video. Could you please concentrate a few videos on the interaction of the Unity timescale and physics system? kthxbye.
Hi, to give a bit more detail, if you set the timescale to zero the FixedUpdate method will not be called on any of your Game Objects. It's unlikely that you would need FixedUpdate to be called when the game is paused so it should be fine, but if you did need to have FixedUpdate called when paused then you'd have to do a bit more work yourself. Instead of setting timescale to zero you'd need to subscribe to the paused event and pause movement, animations etc all yourself. I wouldn't recommend it unless you really need it 😊
Pausing and Unpausing can be surprisingly complex! This tutorial covers some of the basics well. You can also Pause your game without adjusting TimeScale at all, but you need a function that'll go through and more manually pause/disable aspects of all your objects! This can seem a bit over the top, but at the end of the day, you may need to. And the code used is similar to a lot of Save/Load functionality, which you'll also maybe need to do! I made a Pause / Unpause / Save / Load base game architecture project, with explanation videos, and a way to download the project here, if you're interested... th-cam.com/users/playlist?app=desktop&list=PLA2kYB0UP03AjXCgnZ4Wl35BDgq2bZzWZ Check out the final video in the playlist for the latest version of the project.
instead of if() and else() in the pause script, you can also use ":" and "?" to set Time.timeScale to 0 and 1 according to if _isPaused is true or false
Wow, this is such a great tutorial. This channel never disappoints❤
Thanks for your support 😊
I watched this just to see if you showed unscaled time but honestly I found it neat that you used unity events for the paused game status. Good work.
My favorite Unity channel, everything is very clear and straight to the point.
Could you possibly make tutorials about UI?
Rect transform
UI components in Unity and how to use them
How you setup your UI
maybe even instantiating UI because controlling UI from script is quite different from normal objects.
Thank you for the amazing tips and tutorials!
Thanks so much for this comment. We'll definitely be covering UI elements in the future 😊
Really great tutorials, I'm all caught up now and checking out some of your other stuff. Cant wait to see where you take this, this truly is one of the better tutorials out there!
Thanks so much for your support 😊
Thank you for this lesson. As others have said, this is a really useful way of using events!
Glad you found it helpful 😊
Nice and concise, love the content -- keep it up!
Great to hear, thanks 😊
Thanks for this very useful video
Glad it was helpful 😊
Thanks
👍😊
Great video! I already knew about Time.timeScale but it was good to learn about the Animation and Update tidbits.
Amazing content thank you so much !
Thanks for this comment 😊
*Brackeys, watch out.*
👍😊
Thank you:)
👍😊
Nice tuts!
I hope next you do how to make the same character transfer between levels/maps/scenes like for example the character goes into a portal, the map will change to indicate that the character have traveled through the portal.
your videos is always cool ..
Thanks for your support 😊
The way you explain things is fantastic!
Could you do a tutorial on flying?
Thanks for this comment.
We'll add flying and gliding to the list of potential future videos 😊
nice
👍😊
This is probably a good simple way to do it for small scale projects, but more main stream ones. It's best to use a scriptable object that can be read from any script, and check within the scripts themselves. This provides full control. Wrap all your inputs with a bool check except for the pause input.
Hi, thanks for suggesting an alternative solution. Do you use the scriptable object just to stop input and still use timescale zero to pause animations, tree sway etc?
@@KetraGames it all depends, using the SO to set the value allows for full control. It allows you to pause or unpause certain elements of state machines, you can use it to turn off processes in shaders that are not bound by time scale. And if you do want an unscaled object to be paused under very specific situations, you can do it that way too.
you can go as far as making an enum into a scriptable object and development different paused states / levels. Each level creating a different amount of influence depending on the need.
@Dwight Potvin, thanks so much for this. Enhancing the solution with a Scriptable Object would definitely be beneficial
@@KetraGames In general, getting people more familiar with SO's, even if it's something as small as a pause value in a tutorial, will benefit them in the long run. Especially since Unity is pushing heavily for SO's to be their main form of serialization.
How would you freeze a single character? ie with a freeze ray or ice spell?
would it be possible to make an IPausable interface that anything you want to be paused could be haulted in their update? or would a C# interface not allow you to make that check? just thinking about having to go through everything in the game that may want to have a pause feature, and my brain would probably forget some of them unless i planned in advance. Or maybe a base class? or are neither of those a possibility?
Hi, good idea. You could create an empty interface that you assign to all scripts you want to pause. Then you could disable any scripts with this interface to stop the update method being called. Hope that helps 😊
@@KetraGames awesome!! i had some strict coworkers that really pushed me on that stuff. it's encouraging to see that some of that stuck with me. do you get into inheritance some with unity, or does that conflict with unity's component based architecture?
@@stevethepirate Inheritance isn't something that I tend to use much, but it can work in Unity. I'd advise to use it sparingly though. I'm sure you know this, but it's generally better to favour composition over inheritance, which Unity's component based architecture is geared toward.
@@KetraGames oh okay! did not know that it isn't usually a good idea in Unity! thank you!
THANKYOU SOOO SOOO MUCH! I do have one question though, how would I unlock and show my curser when paused? again, thank you sooo muccchhhh!
Hi, to unlock the cursor when paused write a script with a method that sets the cursor lockstate to none - Cursor.lockState = CursorLockMode.None.
Then you can hook up the Unity event to call this method when the game is paused. You would also need to do the opposite when the game resumes.
Hope that helps 😊
Not ideal if you're manipulating timescale for any other reason. But a lock and key system overcomes that.
I didn't follow all of the last 30 seconds or so of this video. Could you please concentrate a few videos on the interaction of the Unity timescale and physics system? kthxbye.
Hi, to give a bit more detail, if you set the timescale to zero the FixedUpdate method will not be called on any of your Game Objects. It's unlikely that you would need FixedUpdate to be called when the game is paused so it should be fine, but if you did need to have FixedUpdate called when paused then you'd have to do a bit more work yourself. Instead of setting timescale to zero you'd need to subscribe to the paused event and pause movement, animations etc all yourself. I wouldn't recommend it unless you really need it 😊
Pausing and Unpausing can be surprisingly complex! This tutorial covers some of the basics well.
You can also Pause your game without adjusting TimeScale at all, but you need a function that'll go through and more manually pause/disable aspects of all your objects!
This can seem a bit over the top, but at the end of the day, you may need to.
And the code used is similar to a lot of Save/Load functionality, which you'll also maybe need to do!
I made a Pause / Unpause / Save / Load base game architecture project, with explanation videos, and a way to download the project here, if you're interested...
th-cam.com/users/playlist?app=desktop&list=PLA2kYB0UP03AjXCgnZ4Wl35BDgq2bZzWZ
Check out the final video in the playlist for the latest version of the project.
Thanks for sharing your solution 😊
instead of if() and else() in the pause script, you can also use ":" and "?" to set Time.timeScale to 0 and 1 according to if _isPaused is true or false
Thanks for sharing your tip 😊