This tutorial will explain how to create a loading bar in Unity. This is the second part of a longer series on scene management.
This tutorial shows how the manage scenes and levels in Unity 5.3, with the introduction of
- Part 1. What’s new in Unity 5.3
- Part 2. Accessing the SceneManager class
- Part 3. Retrieving the current scene
- Part 4. Loading a single scene
- Part 5. Reloading a scene
- Part 6. Issues
This post will show how to simulate cellular automata using shaders. The popular cellular automaton developed by John Conway, Game of Life, will be used as an example for this tutorial. To learn how to set up your project, check out the first two parts of this tutorial: How to Use Shaders For Simulations and How to Simulate Smoke with Shaders.
- Part 1. Conway’s Game of Life
- Part 2. Implementation
- Part 3. Optimisation
- Part 4. Improvements
- Conclusion & Downloads
In this tutorial you will learn how Unity and Arduino can communicate using the serial port. This tutorial requires both C# and Arduino scripts; the labelsand will be used to avoid confusion.
- Step 0: Configuring…
- Step 1: Opening…
- Step 2: Writing…
- Step 3: Reading…
- Step 4: Communicating…
The topic of connecting Arduino to Unity is further expanded in Asynchronous Serial Communication, where you can also download the entire Unity package.
This tutorial will teach you how to create non euclidean cubes in Unity, giving the illusion that each face is a door onto another dimension. This post is part of a series of tutorials on impossible geometries.
This effect can be seen in many game, most notoriously Antichamber which uses it extensively.
- Step 1. Stencil Theory
- Step 2. The stencil mask
- Step 3. The stencil geometry
- Step 4. Putting all together
Unity has the ability to import pieces of code written (and compiled) in other languages; they are called Native Plugins, and this tutorial will teach you how to build them.
- Step 1: Creating a C++ project
- Step 2: Writing the library
- Step 3: Compiling
- Step 4: Importing in Unity
- Step 5: Using in Unity
In a previous post I’ve introduced the Gaussian distribution and how it is commonly found in the vast majority of natural phenomenon. It can be used to dramatically improve some aspect of your game, such as procedural terrain generation, enemy health and attack power, etc. Despite being so ubiquitous, very few gaming frameworks offer functions to generate numbers which follow such distribution. Unity developers, for instance, heavily rely on
Random.Range which generates uniformly distributed numbers (in blue). This post will show how to generate Gaussian distributed numbers (in red) in C#.
I’ll be explaining the Maths behind it, but there is no need to understand it to use the function correctly. You can download the
RandomGaussian Unity script here.
One of the most interesting feature of Unity is the ability to extend its editor and standard components. This has allowed developers all around the world to create amazing extensions which dramatically improve Unity’s usability. And, in some cases, compensate for its shortages. A very intriguing feature which is not-so-well known is the ability to customise the messages in the debug console. Rather than give you a self proclaimed ultimate solution to console debugging, this post will cover different topics to help you creating your own.
Following the heritage of C++, C# comes with a number of powerful features which can either be used to massively improve your code …or to make it completely unreadable. In this post we’ll discuss a technique to add new methods to already existing classes. Yes, even classes you don’t have access to such as
Rigidbody and even
string. Let’s introduce extension methods with a practical example.
If you’re a game developer chances are you’re familiar with the need to describe different variations of an attribute. Whether it’s the type of an attack (melee, ice, fire, poison, …) or the state of an enemy AI (idle, alerted, chasing, attacking, resting, …) you can’t escape this. The most naive way of implementing this is simply by using constants:
public static int NONE = 0; public static int MELEE = 1; public static int FIRE = 2; public static int ICE = 3; public static int POISON = 4; public int attackType = NONE;
The downside is that you have no actual control over the values you can assign to
attackType: it can be any integer, and you can also do dangerous things such as