Learn C# scripting in Unity
Are you just starting with Unity and want to learn how to
program in C#? Are you a veteran that finally wants to do some serious scripting?
Check out these tutorials!
- Clock
-
This tutorial introduces you to Unity and creating C# scripts. You will create a simple clock
that always shows the current time.
- Graphs
-
This tutorial introduces you to more advanced C# concepts, including arrays, loops, and delegates.
You will create a collection of increasingly complex graphs, from a simple line to a tiny voxel
system.
- Runner
-
This tutorial is about creating a very simple endless 2D side-scroller. It involves physics,
object queues, a GUI, user input, and a simple event manager.
- Star
-
This tutorial shows you how to create your own custom editor. You will make a star component that
uses a dynamically generated mesh. Then you will build a nice inspector for it, add WYSIWYG editing,
and allow editing right in the scene view, while supporting undo, redo, reset, prefabs, and multi-object editing.
Countdown to Next Tutorial
I will create the next tutorial days from now, which would be .
Don't want to wait so long? You can help! Donate, and the countdown goes faster. So you can either wait and
get it for free after a long time, or donate and everyone gets it sooner. Time, or money. It's your choice.
-
$1 == 1 day
USD
-
€1 == 1.35 days
EUR
For each dollar (USD) that gets donated, the counter decreases by one day.
Each euro that gets donated decreases the counter by 1.35 days.
I update the countdown reduction every few days, so the effect of your donation won't be immediately visible.
Questions & Answers
- Why text and not video tutorials?
-
As these tutorials are about writing code, it seems natural to use text. Understanding the code
might require a lot of jumping back and forth, pausing, looking things up, experimenting, and so
forth, all at your own pace. I think text is more convenient than video for this.
Also, video tutorials seem to be proliferating and I didn't want those that prefer text to be
left out in the cold.
- Why C# and not JavaScript?
-
Compared to Javascript, C# has a stricter and more verbose syntax. I think this is a feature if you
really want to understand what you are doing. Going from strict to lax later is easy, the other way
around not so much.
Also, C# in Unity is the real thing. With very few exceptions, it is exactly like C# would be in
any other .NET or Mono project. Almost all online documentation about C# is useful and all standard
libraries are available. This is not really true for Unity's JavaScript, which is actually
UnityScript.
- Why not Boo?
-
It's the least used option of the three available languages. Considering the available information
for the other two, I wouldn't learn Boo as my first programming language.
- Why such a long countdown?
-
I enjoy making these tutorials, but it requires a lot of time. Unfortunately, I can't spend much of my time
on creating tutorials, because I need it for other stuff, like making a living and having a life. Donations allow
me to claim some of that time for tutorial work.