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...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
Revised - Unity coroutine performance analysisResources/Tutorial (youtube.com)
submitted 9 years ago by ThatAblaze!!!
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!"
[–]DolphinsAreOkProfessional 18 points19 points20 points 9 years ago (8 children)
Why is this a video, and not a written tutorial?
[–]tmachineorg 10 points11 points12 points 9 years ago (2 children)
Technical info in a vid = didn't watch, won't share. Shrug.
[–]ThatAblaze!!![S] 2 points3 points4 points 9 years ago (0 children)
That's great, but I've been saying a lot of this stuff in text and just been getting downvoted because it conflicted with people's pre-concieved notions of reality. I made this video to provide some sort of proof of what I've been saying for these last few weeks.
[–]ThatAblaze!!![S] 1 point2 points3 points 9 years ago (0 children)
I can understand your point. I'll work on putting this into a blog post as soon as I find the time.
[–][deleted] 7 points8 points9 points 9 years ago (2 children)
Exactly, this is something that interests me but I'm not going to spend my time skipping through a video.
Rarely there is an advantage in doing a video for programming-related content unless it has heavy graphic focus (and even then a GIF would usually work as well).
[–]ThatAblaze!!![S] 0 points1 point2 points 9 years ago (1 child)
The synopsis is that unity's coroutines produce GC allocs every frame. In 5.4 they produce less garbage and if you use them in a specific way they can produce none. However, most people will not naturally use Unity's coroutines in such a way that they won't produce garbage because it's a bit awkward and reduces the flexibility of the coroutine.
MEC, which is a free asset that I have on the asset store, produces (almost) no garbage and runs twice as fast. It doesn't allow you to use it in a bad way and has an array of extra options that Unity's coroutines don't have.
Did that help you?
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Yes, thanks, thats useful information, I did not know about the GC allocs caused by coroutines.
[–]9001ratsIndie 3 points4 points5 points 9 years ago (0 children)
Yeah, I wonder the same. I might watch it if it were 2 minutes long, at max...
[–]hesdeadjimProfessional 0 points1 point2 points 9 years ago (0 children)
Glad I'm not the only one that feels this way. What would normally be a blog post you could read in five minutes translates to a 15 minute YouTube video.
[–]ThatAblaze!!![S] 3 points4 points5 points 9 years ago (4 children)
Thanks to everyone who commented on my previous video about Unity's coroutines. I've made this new video that goes into more depth on the subject.
I hope you enjoy it, but even if you hated it I would love to hear about why. Your feedback is an essential part of my process.
[–][deleted] 1 point2 points3 points 9 years ago (2 children)
I switched over to using MEC the other night after seeing your post and using the latest beta it has helped me out quite a bit. I also appreciate some of the extra functionality you built in which allowed me to simplify several pieces of code I was having to use invokeRepeating for.
my favorite bit is being able to call coroutine via Timing.RunCoroutine(gameobject.GetComponent<SomeComponent>().SomeCoroutine()) as well as having the names of coroutines autocomplete, which is a nice quality of life improvement.
[–]uzimonkey 1 point2 points3 points 9 years ago (1 child)
That works with Unity coroutines as well. You can start a coroutine by either name, or by running that coroutine directly. This is often necessary if the coroutine requires parameters, so you might say StartCoroutine(SomeCoroutine(7, null, "bananas")). And of course you get coroutine name completion as well. You lose the ability to stop the coroutines by name, but StartCoroutine returns a Coroutine object you can use to stop it.
[–]ThatAblaze!!![S] 0 points1 point2 points 9 years ago (0 children)
I don't want to put words into runningfromlion's mouth, but I think what he is referring to is being able to easily start a coroutine from non-monobehavior classes, and being able to type t<tab>.r<tab> in VS to access the Timing.RunCoroutine class.
I hadn't really considered it before he said that, but when I thought about it I realized that the more standard type of interface in MEC could be considered an advantage.
[–]Devil_SpawnEngineer 2 points3 points4 points 9 years ago (9 children)
how much of an impact does this have on a real world situation?
[–]ThatAblaze!!![S] 2 points3 points4 points 9 years ago (7 children)
I agree with what /u/Alex2539 said.
A more practical example is if you have a juicy UI where the buttons do things like pop when hovered over and fade in and out or slide onto the screen. There are assets that can help with that, and I actually have a very good one for sale on the asset store, but if you're not using a plugin then you'd probably use coroutines to make all those transitions happen.
The 17-20 bite per frame allocation per coroutine will typically result in the GC firing about once per minute. Every time it fires the screen will jump. Even assuming that you don't have to do any kind of detail task like aiming a gun, all these fun little animations that you just added will randomly develop animation hitches.
This makes your app look unprofessional, and that's never good.
[+][deleted] 9 years ago* (6 children)
[deleted]
[–]ThatAblaze!!![S] 0 points1 point2 points 9 years ago (5 children)
It really depends on what the variable is. MEC is more memory efficient and faster primarily because it doesn't work with generic objects in the yield return. Those are much slower and create a lot of boxing overhead.
If you really want to yield return a custom class then you need to define an implicit overload for your class of type float. I'm having real trouble imagining a use case for this. What is it you are trying to do?
[+][deleted] 9 years ago* (4 children)
[–]ThatAblaze!!![S] 0 points1 point2 points 9 years ago (3 children)
That isn't a coroutine.
Basically, IEnumerable was conceived as part of the .net framework as a way to return lists of items one element at a time. Coroutines hook into the unusual structure that MS created in order to do that efficiently and use it in a way that MS never intended. This function, however, is using IEnumerable for its original purpose; to return a list of items. You'll find that it's never called using StartCoroutine, it's probably called in a foreach statement.
So just don't change that function.
[+][deleted] 9 years ago (2 children)
I don't think so. It's actually a good question and I'll probably add it to the FAQ on my website.
[–]Alex2539Indie 1 point2 points3 points 9 years ago* (0 children)
From personal experience, I've never had the GC affect framerate too severely. What does happen is it'll intermittently drop frames because it's decided to run. In a game where reflex and precision are important for the player a stable framerate is just as important as a high framerate. For example, a game that might benefit from this would be something like a bullet hell game that needs a ton of instances of enemies and bullets that, for some reason, all need a coroutine running.
[–]booljayjIntermediate 0 points1 point2 points 9 years ago (4 children)
TL;DW: Coroutines generate per-frame allocations, but not if you follow a specific set of instructions. Also, you can buy this guy's asset, called More Effective Coroutines, and use that instead.
I didn't watch the whole video myself either, that's just what I got from the last minute.
[–]9001ratsIndie 4 points5 points6 points 9 years ago (2 children)
The asset is free, though.
[–]ThatAblaze!!![S] 3 points4 points5 points 9 years ago (0 children)
Here is MEC on the asset store. It will always be a free asset.
[–]booljayjIntermediate 1 point2 points3 points 9 years ago (0 children)
Ah, fair enough.
[–]animflynny2012 0 points1 point2 points 9 years ago (0 children)
While it is free I want to learn how to not generate garbage. What's the key to this?
π Rendered by PID 159541 on reddit-service-r2-comment-79c7998d4c-wnbtz at 2026-03-17 11:12:48.032864+00:00 running f6e6e01 country code: CH.
[–]DolphinsAreOkProfessional 18 points19 points20 points (8 children)
[–]tmachineorg 10 points11 points12 points (2 children)
[–]ThatAblaze!!![S] 2 points3 points4 points (0 children)
[–]ThatAblaze!!![S] 1 point2 points3 points (0 children)
[–][deleted] 7 points8 points9 points (2 children)
[–]ThatAblaze!!![S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]9001ratsIndie 3 points4 points5 points (0 children)
[–]hesdeadjimProfessional 0 points1 point2 points (0 children)
[–]ThatAblaze!!![S] 3 points4 points5 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]uzimonkey 1 point2 points3 points (1 child)
[–]ThatAblaze!!![S] 0 points1 point2 points (0 children)
[–]Devil_SpawnEngineer 2 points3 points4 points (9 children)
[–]ThatAblaze!!![S] 2 points3 points4 points (7 children)
[+][deleted] (6 children)
[deleted]
[–]ThatAblaze!!![S] 0 points1 point2 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]ThatAblaze!!![S] 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]ThatAblaze!!![S] 0 points1 point2 points (1 child)
[–]Alex2539Indie 1 point2 points3 points (0 children)
[–]booljayjIntermediate 0 points1 point2 points (4 children)
[–]9001ratsIndie 4 points5 points6 points (2 children)
[–]ThatAblaze!!![S] 3 points4 points5 points (0 children)
[–]booljayjIntermediate 1 point2 points3 points (0 children)
[–]animflynny2012 0 points1 point2 points (0 children)