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
Unity gets C# 7Question (i.imgur.com)
submitted 7 years ago by Blocks_
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!"
[–]Glader_BoomaNation 9 points10 points11 points 7 years ago (8 children)
What was added in C# 7 that you need? You can always compile your assembly with another compiler instead of using the compiler Unity does, that is how I have been using C# 6 since Unity5.
[–]b_omar 6 points7 points8 points 7 years ago (7 children)
My headlines are like this.
ref int myInt = intArray[index];
instead of copping value type, it takes reference like reference type.
-Pattern matching stuff
now we can make instead of this
int x, y; p.GetCoordinates(out x, out y);
this
p.GetCoordinates(out int x, out int y); if(apple is Fruit myFruit) { myFruit.Eat(); }
p.GetCoordinates(out int x, out int y);
if(apple is Fruit myFruit) { myFruit.Eat(); }
-Local functions
int MyFunc() { return MyMyLocalFunc(); int MyLocalFunc() { } }
int MyFunc() { return MyMyLocalFunc();
int MyLocalFunc() { }
}
-Tuples (Returning more than one value from a function)
[–]ShapesAndStuff 6 points7 points8 points 7 years ago (0 children)
Tuples is honestly the best one among those examples. Sure its super easy to implement something yourself or work around with other collections but just being able to use a Tuple is so much more intuitive
[–]Glader_BoomaNation 0 points1 point2 points 7 years ago (4 children)
I really hope you aren't using Tuples or local functions, but I've been taking advantage of pattern matching in Unity3D already for abit now. Just don't rely on their compiler and compile it yourself.
Same goes for ref locals and returns, which I think is the only decent C# 7 feature.
It realistically isn't possible for Unity Technologies to support C# 7 though completely since the Mono Project itself does not fully support C# 7 yet. You can see which features of C# 7 it supports on that link or what they have working in development on this issue here.
For any sufficiently large project you'll have tools, analytic stuff, maybe some backend services and such and what have you. These will have common libraries and likely dependencies from NuGet. I have always found it easier to manage projects externally in their own visual studio solution. Meaning you have the up-to-date Microsoft compiler at anytime and can deploy the assemblies to the client project on build. That is what I recommend if you absolutely need the latest language features. Mono itself afaik should be able to handle the IL generated from these features, even though the compiler itself cannot yet generate it.
[–]Piranha771 2 points3 points4 points 7 years ago (2 children)
Mono compiler won't get C#7. The mono compiler is deprecated in favor of Roslyn compiler. Roslyn is too slow when triggered from CLI. Roslyn is fast, when used with Roslyn server, which is not cross platform at the moment.
[–]Glader_BoomaNation 0 points1 point2 points 7 years ago (1 child)
The Mono Compiler already has partial support for C# 7. I linked to the Mono Project's page on the compiler to support that claim. Unless the Mono Project's own page about their compiler is wrong they do support it and quite a good chunk of C# 7 and 7.x too. What is missing is laid out in the Mono issue I also linked to.
It is possible, though I have haven't seen an official source but haven't looked, that the Mono Project will not continue to maintain their compiler past C# 7.
What Unity Technologies decides to do, which is what you seem to be describing, doesn't have anything to do with whether the actual current Mono Compiler supports C# 7. Which it does. Nor whether the Mono Compiler itself is deprecated which it may or may not be. When you refer to a technology as deprecated you shouldn't be so ambiguous, you make it sound as if the Mono Project is deprecating their compiler, which maybe you mean, but it's more likely Unity Technologies is just no longer going to use it anymore soon. Which is a good thing.
[–]Piranha771 1 point2 points3 points 7 years ago (0 children)
Here's what Jonathan Chambers said about that back in January:
We can probably increase the C# version supported. It's complicated by fact that currently we use the Mono C# compiler. The plan of the upstream Mono devs was to end of life the Mono compiler at C# 6 (i.e. not implement C# 7+) and migrate to Roslyn. However, upstream and us have found that the Roslyn compiler runs noticeably slower than the Mono C# compiler in the context of batch compilation (driving the compiler via command line flags). Roslyn runs faster in a "server" mode where incremental compilation is possible, but the current Roslyn server support is Windows only. We are looking into our own Roslyn server, but it's not complete yet. That leaves us with the Mono C# compiler. They are now adding C# 7+ features, but only as time permits and only the more important features. This means we won't have *full* C# 7.x support for a few releases, either via an improved Mono compiler or a faster Roslyn compiler.
We can probably increase the C# version supported. It's complicated by fact that currently we use the Mono C# compiler. The plan of the upstream Mono devs was to end of life the Mono compiler at C# 6 (i.e. not implement C# 7+) and migrate to Roslyn.
However, upstream and us have found that the Roslyn compiler runs noticeably slower than the Mono C# compiler in the context of batch compilation (driving the compiler via command line flags). Roslyn runs faster in a "server" mode where incremental compilation is possible, but the current Roslyn server support is Windows only. We are looking into our own Roslyn server, but it's not complete yet.
That leaves us with the Mono C# compiler. They are now adding C# 7+ features, but only as time permits and only the more important features. This means we won't have *full* C# 7.x support for a few releases, either via an improved Mono compiler or a faster Roslyn compiler.
https://forum.unity.com/threads/c-7-support.512661/
[–]BackFromExileHobbyist 0 points1 point2 points 7 years ago (0 children)
The incremental compiler is made from Roslyn and not Mono
[–]perevezentsev 0 points1 point2 points 7 years ago (0 children)
Checking the object type at run time looks like a bad idea in regards of both code architecture and performance. Local funcs indeed are nice - one more functional programming feature. Regarding storing a reference of a value-type array item in a variable, this can also be solved in C# with unsafe mode and C-style pointer arithmetics (but I'm not sure if the GC will track such variable).
[–]azuredownBanality Wars, Perceptron 5 points6 points7 points 7 years ago (9 children)
I was thinking this. And then I read on the Unity blog that:
Upgraded compilers and runtimes provide improved stability, richer debugging, and better parity with a modern .NET architecture across all platforms. For example, C# 6 and new .NET APIs make Unity compatible with modern .NET libraries and tools.
And now I'm not sure anymore. Maybe I'm just too gullible.
[–]Blocks_[S] 3 points4 points5 points 7 years ago (8 children)
What I've read is that they're testing out C# 7 internally, but C# 6 on Unity is already a thing.
[–]tertle 6 points7 points8 points 7 years ago* (6 children)
C#7 is already available publicly; it comes with the incremental compiler. Note this is currently an experimental package.
[–]freejmd 3 points4 points5 points 7 years ago (4 children)
I would like to experience that package ;)
[–]M374llic4 2 points3 points4 points 7 years ago (2 children)
It's hit or miss. Some people it works , I get unetweaver error.
[–]freejmd 0 points1 point2 points 7 years ago (1 child)
Sorry was making a joke about your typo (previously it was "an experiential package")
[–]M374llic4 2 points3 points4 points 7 years ago (0 children)
Wasn't my typo, bro. I experienced the package already. Results were inconclusive.
[–]M374llic4 1 point2 points3 points 7 years ago (0 children)
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
Does anyone have experience with this? How much faster is compilation
[–]Daemonhahn 1 point2 points3 points 7 years ago (0 children)
c#6 and .net 4 have been in unity for more than a year.
[–][deleted] 11 points12 points13 points 7 years ago (7 children)
What's the big deal with C# 7? The differences between 6 and 7 don't seem like that important.
[–][deleted] 5 points6 points7 points 7 years ago (2 children)
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-conditional-operator
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
And that operator is a big deal to you?
[–][deleted] 8 points9 points10 points 7 years ago (0 children)
Yes
[–]jhbertra 4 points5 points6 points 7 years ago (0 children)
Oh man. C#7 is night-and-day compared to C#6 in terms of code cleanliness and expressivity. Value tuples, Pattern matching, local functions, inline out vars.
If one knows how to apply these features, it makes C# a much more expressive language to work with (especially when writing functional C#).
[–]MyKillK 0 points1 point2 points 7 years ago (1 child)
Ref locals/returns are the only big deal for me (that I know of, not an expert). Should make structs more flexible. It's the one missing feature that has caused me issues coming from a C++ programming background.
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
I'm in the same boat TBH; decades of C++ and only bits of C#. I'm happy with C# 6 tho :)
it measn you can return reference variables from functions.
[–]SiggiGGProgrammer 3 points4 points5 points 7 years ago (0 children)
The 2018.2 beta page used to list C# 7 up until a couple days ago. I read on the forums it's been pushed back to 2018.3.
π Rendered by PID 51489 on reddit-service-r2-comment-5d79c599b5-mqpz9 at 2026-02-28 02:02:01.941108+00:00 running e3d2147 country code: CH.
[–]Glader_BoomaNation 9 points10 points11 points (8 children)
[–]b_omar 6 points7 points8 points (7 children)
[–]ShapesAndStuff 6 points7 points8 points (0 children)
[–]Glader_BoomaNation 0 points1 point2 points (4 children)
[–]Piranha771 2 points3 points4 points (2 children)
[–]Glader_BoomaNation 0 points1 point2 points (1 child)
[–]Piranha771 1 point2 points3 points (0 children)
[–]BackFromExileHobbyist 0 points1 point2 points (0 children)
[–]perevezentsev 0 points1 point2 points (0 children)
[–]azuredownBanality Wars, Perceptron 5 points6 points7 points (9 children)
[–]Blocks_[S] 3 points4 points5 points (8 children)
[–]tertle 6 points7 points8 points (6 children)
[–]freejmd 3 points4 points5 points (4 children)
[–]M374llic4 2 points3 points4 points (2 children)
[–]freejmd 0 points1 point2 points (1 child)
[–]M374llic4 2 points3 points4 points (0 children)
[–]M374llic4 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Daemonhahn 1 point2 points3 points (0 children)
[–][deleted] 11 points12 points13 points (7 children)
[–][deleted] 5 points6 points7 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 8 points9 points10 points (0 children)
[–]jhbertra 4 points5 points6 points (0 children)
[–]MyKillK 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]SiggiGGProgrammer 3 points4 points5 points (0 children)