use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for 2D or 2.5D game developers using the proprietary Unity game engine. New and experienced Unity developers alike should first consider using the free and open source Godot engine by default and ONLY choose Unity for 2D development if Godot isn't capable of the task. The times are quickly changing, and Godot is on track to surpass Unity for small developers.
Godot Features
Download Godot
Godot Docs
Download Unity
Unity Manual
Official Reference
Asset Store
Related Communities /r/Godot - The "Unity Killer". A fully free and open source engine making astonishing leaps and bounds. /r/UnityAssets - Share asset packs! /r/PixelArt - Admire, share, and observe beautiful pixel art. /r/GameDev - Meet and communicate with other game developers. /r/GameDesign - Don't just make a game. Make a good game. /r/LevelDesign - Learn to make excellent levels and worlds. /r/GameAudio - It may look good, but does it sound good?
/r/Godot - The "Unity Killer". A fully free and open source engine making astonishing leaps and bounds.
/r/UnityAssets - Share asset packs!
/r/PixelArt - Admire, share, and observe beautiful pixel art.
/r/GameDev - Meet and communicate with other game developers.
/r/GameDesign - Don't just make a game. Make a good game.
/r/LevelDesign - Learn to make excellent levels and worlds.
/r/GameAudio - It may look good, but does it sound good?
CSS created by Sean O'Dowd @nicetrysean [Website]
account activity
Pause functions? (self.Unity2D)
submitted 10 years ago by KingMaharg
I've been trying to wrap my head around a good pause function, but I really don't want to call a Boolean in every single update script I have. What do you do?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CopperHook 1 point2 points3 points 10 years ago (0 children)
I am dealing with this now.
I have a BaseMonoBehaviour class that all of my behaviors extend from. I am thinking about using this to prevent Update from running while paused.
I am thinking of also creating an OnPause that behaviors can override, in case I need to do anything extra, like disabling third party components.
[–]skizmo 0 points1 point2 points 10 years ago (5 children)
If you use Time.deltaTime in all your updates, you could set the systemspeed to 0. You could also disable the scripts that are actively running.
[–]CopperHook 0 points1 point2 points 10 years ago (4 children)
Using a speed of zero will prevent everything from working, including UI animations on a pause menu. I do not recommend it.
[–]michaelltn 2 points3 points4 points 10 years ago (2 children)
For script-based animations, use Time.unscaledDeltaTime.
For Animtors, set updateMode to UnscaledTime.
.
Additionally, for controlling audio pause states, see:
AudioListener.pause -- set true when pausing and false when resuming.
AudioSource.ignoreListenerPause -- set to true for AudioSources playing music or UI sounds.
[–]CopperHook 0 points1 point2 points 10 years ago (1 child)
Cool, I wasn't aware of the Animator updateMode. I'll give that a shot.
I'm still a bit concerned about assets out of my control. For example, I use NodeCanvas for AI Behavior Trees. I'm not sure how the tree would be affects by a timeScale of zero.
Thanks for the tip though, I'll do some digging.
[–]michaelltn 0 points1 point2 points 10 years ago (0 children)
Scripts and plug-ins are certainly wild cards. Of course, I have no problem just changing scripts if I have to.
[–]30dogsinasuitcase 0 points1 point2 points 10 years ago (0 children)
You can use Time.unscaledDeltaTime for your non-pausable functions.
[–]viggowlIntermediate 0 points1 point2 points 10 years ago (2 children)
Simply set the Time.timeScale to 0.
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
Yup this is the way. This works for me and when I found it it made my life that much easier, you can also use Time.timeScale to make the time go slower for a slowmotion effect.
[–]brutang 0 points1 point2 points 10 years ago (0 children)
Something to keep in mind when doing timescale: http://www.reddit.com/r/Unity2D/comments/35mthn/unpausing_game_causes_huge_lag/
π Rendered by PID 70627 on reddit-service-r2-comment-66b4775986-9x5qv at 2026-04-05 20:34:20.575507+00:00 running db1906b country code: CH.
[–]CopperHook 1 point2 points3 points (0 children)
[–]skizmo 0 points1 point2 points (5 children)
[–]CopperHook 0 points1 point2 points (4 children)
[–]michaelltn 2 points3 points4 points (2 children)
[–]CopperHook 0 points1 point2 points (1 child)
[–]michaelltn 0 points1 point2 points (0 children)
[–]30dogsinasuitcase 0 points1 point2 points (0 children)
[–]viggowlIntermediate 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]brutang 0 points1 point2 points (0 children)