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 all written, not videos. They are enhanced with plenty of screenshots and diagrams. Recent tutorials also contain short animations.
The tutorials are written by me, Jasper Flick from Catlike Coding.
Become My Patron
Your support makes these tutorials possible! If you like them and want to see more, please become my patron. Or make a one-time donation.
These tutorials provide an introduction to working with C# in Unity.
Game Objects and Scripts
Build a clock with simple objects, then animate it with a custom script.
Building a Graph
Instantiate and control a line of objects to visualize a mathematical function.
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.
Frames Per Second
Design a test scene to tank your FPS, then measure it with your own counter.
Create a fountain of stuff, then feed it with your own object pools.
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.
An introduction to procedural meshes. From a simple grid to deformable balls.
Create a simple grid of vertices and triangles.
Use your knowledge of grids to build a rounded cube.
Turn a cube mesh into a sphere, then use mathematical reasoning to improve it.
Take any mesh and turn it into a deformable stress ball.
A series about understanding Unity's rendering pipeline. How a mesh turns into pixels that look like real objects.
Use matrices to transform space.
Write your first shader, from scratch.
Mix multiple textures to add details and variety.
The First Light
Go from a single dot product all the way to physically-based shading.
Support complex lighting with pixel, vertex, and spherical harmonics lights.
Make surfaces look bumpy, by using height fields, normal maps, and tangent space.
Make objects both cast and receive shadows.
Use reflection probes to turn surfaces into mirrors.
Create a custom shader GUI and support metallic, smoothness, and emission maps.
Use occlusion maps and details masks. Also support multi-material editing.
Make parts of your surfaces disappear.
Support shadows with holes in them.
Add support for the deferred rendering path.
Include fog in forward shading, and use an image effect for deferred fog.
Render deferred lights after filling the G-buffers.
Baking lighting for static geometry into lightmaps.
Combine baked and realtime lighting in various ways.
Realtime GI, Probe Volumes, LOD Groups
Support dynamic global illuminates, use probe volumes for large objects, and adjust what's rendered based on view size.
Render many similar objects in a few batches.
Add a convincing illusion of depth to surfaces.
These are tutorials covering more complex or specialized rendering techniques, going beyond Unity's standard shaders. They build on the work done in the Rendering series.
Flat and Wireframe Shading
Use screen-space derivative instructions and a custom geometry shader stage to apply flat shading and a wireframe effect to any mesh.
A series about hexagon maps. Lots of strategy games use them.
Creating a Hexagonal Grid
Generate a simple hex grid and support in-game editing of cell colors.
Blending Cell Colors
Connect cell with each other and blend their colors.
Elevation and Terraces
Give cells different elevation levels and connect them with terraces.
Perturb cell edges and elevations to produce a more natural map.
Make large maps possible, and provide the tools to edit them.
Draw rivers across the terrain, and animate them.
Add roads to the map, and make them play nice with rivers.
Create bodies of water at various elevations, and flow rivers in and out of them.
Add detail objects to the terrain to represent plants, farmland, and urban development.
Segregate cells by placing walls along their edges.
Support wall towers, bridges, and larger features.
Saving and Loading
Write maps to a file, and read them back.
Make it possible to work with multiple maps of various sizes.
Cover the terrain with textures.
Find the shortest distances to a cell.
Search for the shortest path between two cells.
Split movement into turns and find paths as quickly as possible.
Add unit to the map and move them around.
Send units on a journey across the map.
Fog of War
Distinguish between visible and invisible cells.
Only show parts of the map that have been explored.
Base vision range on elevation and smoothly transition between hidden and visible cells.
Procedural noise is useful for lots of things. This series shows how to make your own value, Perlin, and simplex noise, including their derivatives.
Create a prodedural texture, then fill it with pseudorandom noise. Go from 1D to 3D, generating both Value and Perlin noise.
Create a procedural mesh, using noise to turn it into a terrain. Then compute analytical noise derivatives and create Curl noise.
Discover how to create alternatives for Perlin and Value noise, based on a simplex grid.
A series about drawing and reconstructing shapes using a 2D grid. Why not Marching Cubes? Because the concepts are the same for both 2D and 3D, and dealing with two dimensions is already complex enough.
Build an editable 2D voxel grid, then triangulate it with the Marching Squares algorithm.
Sharing and Crossing
Add vertex sharing and flexible edge crossings to Marching Squares.
Enhance Marching Squares with Hermite data, then reconstruct sharp features and resolve ambiguous cases.
Refactor Marching Squares a bit, then add walls to give it some depth.
Make Marching Squares more colorful by adding support for multiple materials.
Tutorials that can be considered small games.
Create a prototype racing game where you move through endlessly twisting pipes.
Procedurally fill a rectangular area with a random walk. Add walls, doors, rooms, and other details. Then navigate the maze you have created.
These tutorials are old. They work for Unity 4. I won't update them to Unity 5. They still have value, but you'll likely have to make adjustments yourself.
Visualize mathematical functions using particle systems, and even animate them. Show a 1D line, a 2D grid, and a small 3D voxel system.
Create an endless runner game with different platform types and a power-up. Use physics, particle systems, managers, events, and queues.
Create an approximation of a sphere by subdividing the faces of an octahedron. This tutorial was commissioned by Binpress.
Create a custom data type for a colored point, then make it easier to edit by giving it a custom property drawer.
Build an alternative visualization for arrays and list. Then give it a few configuration options.
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.
Questions & Answers
Have a question? Here are a few common ones. Click or touch the questions to see the answers. You can also contact me in various ways.