C# Scripting Tutorials for Unity

These tutorials teach you about C# scripting for Unity. The tutorials build on one another, introducing new programming concepts, math, algorithms, and Unity features. They will be useful to you, whether you're brand new to scripting or an experienced developer.

The tutorials are written by me, Jasper Flick from Catlike Coding.

Patreon

Become My Patron

Your support makes these tutorials possible! If you like them and want to see more, please become my patron. Don't worry, it is completely voluntary to become part of the cool private patron club.

Clock

Clock

Build an analogue clock that shows the current time. While doing so, become familiar with the basics of writing C# scripts in Unity.

Maze

Constructing a Fractal

Recursively add chilren to a game object, add some randomization, and you get your own 3D fractal. Use a coroutine to see it grow.

Maze

Maze

Procedurally fill a rectangular area with a random walk. Add walls, doors, rooms, and other details. Then navigate the maze you have created.

Curves and Splines

Curves and Splines

Start with a line segment, then work your way up to quadratic Beziér curves and splines. All fully editable in the scene view.

Noise

Noise

Create a prodedural texture, then fill it with pseudorandom noise. Go from 1D to 3D, generating both Value and Perlin noise.

Noise Derivatives

Noise Derivatives

Create a procedural mesh, using noise to turn it into a terrain. Then compute analytical noise derivatives to define surface normals and create particle flows with Curl noise.

Simplex Noise

Simplex Noise

Discover how to create alternatives for Perlin and Value noise, based on a simplex grid.

Commissioned Tutorials

Want me to write a tutorial for you? Get in touch!

Octahedron Sphere

Octahedron Sphere

Create an approximation of a sphere by subdividing the faces of an octahedron. This tutorial was commissioned by Binpress.

Older Tutorials

These tutorials hail from the Unity 3 era, but they're all updated to Unity 4.

Graphs

Graphs

Visualize mathematical functions using particle systems, and even animate them. Show a 1D line, a 2D grid, and a small 3D voxel system.

Runner

Runner

Create an endless runner game with different platform types and a power-up. You'll use physics, particle systems, managers, a simple event system, and object queues.

Custom Data

Custom Data

Create a custom data type for a colored point, then make it easier to edit by giving it a custom property drawer.

Custom Data

Custom List

Build an alternative visualization for arrays and list. Give it a few configuration options and make sure that the colored point's drawer plays nice with it.

Custom Data

Star

Using a list of colored points, create a simple star object by means of a dynamic mesh, which exists in edit mode and is editable in the scene view.

Donations

I need financial support to write more tutorials. If you want to help out, please become my patron. In case you can not or do not want to join Patron, you can send me a one-time donation via PayPal.

Questions & Answers

Have a question? Here are some common answers. You can also contact me in various ways.

Why Patreon?

Because cardboard boxes lack power sockets and internet connections, living in one is not an option. Starving or freezing to death is also a killer for productivity. So I need some way to finance the time and effort required to create these tutorials.

I chose Patreon because I like the concept of patronage. You can become a patron, supporting me so I can keep creating tutorials for everyone. And you can get some extra perks too!

Can I use your tutorial code for commercial projects?

Go ahead! You're free to build on the tutorial code however you want, using it for any purpose. You don't need to credit me, but that sure is appreciated!

Make no mistake, the route from these tutorials to a viable commercial product is a long one.

Can I redistribute or translate your tutorials?

Yes, as long as you link to the original tutorials and make clear that you're not the original author.

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.

Finally, Unity Technologies itself is shifting all its focus to C#, turning UnityScript into a second-class citizen.

Why not Boo?
It's the least used option of the three languages available for Unity. Boo gets basically no attention. In fact, Unity will no longer include documentation for Boo in Unity 5.