Category: Tutorial

  • Nested Coroutines in Unity

    Nested Coroutines in Unity

    This tutorial shows how to make the most out of coroutines in Unity.

  • Iterators in C#: yield, IEnumerable & IEnumerator

    Iterators in C#: yield, IEnumerable & IEnumerator

    Iterating over lists in C# is often done using for loops. This tutorial shows how the foreach construct can be coupled with the yield statement to create more elegant and safe code.

  • Fading Sprites in Unity

    Fading Sprites in Unity

    This tutorial shows how to extend the class SpriteRenderer  to support intuitive, painless fading transitions. Despite referring to sprites, this approach can be used to easily animate any property of a game object in Unity. The link for the script used in this tutorial is at the end of the post.

  • Simplified Collision Geometry

    Simplified Collision Geometry

    This tutorial shows how to automatically generate simplified colliders for 3D models imported into Unity. The tutorial uses Google SketchUp as an example, but its knowledge and code is agnostic to whichever modelling tool you are using.

  • Asynchronous Serial Communication

    Asynchronous Serial Communication

    In a previous post, How To Integrate Arduino With Unity, we have shown how data can be sent and received through the serial port. The main problem encountered was dealing with the latency and the delays that communicating across different devices introduces. The solution proposed in that tutorial used a coroutine; decoupling the device communication from the game logic attenuates the…

  • ShaderGUI: Custom Material Inspectors in Unity

    ShaderGUI: Custom Material Inspectors in Unity

    This tutorial explains how to create custom material inspectors for your shaders in Unity 5. This is a tutorial for Unity 5: Unity 4 used MaterialEditor (legacy documentation here) to customise a material’s inspector. That is now deprecated; you should use the new ShaderGUI (documentation here) instead.

  • Arrays & Shaders in Unity 5.4+

    Arrays & Shaders in Unity 5.4+

    This post shows how to use arrays and shaders in Unity 5.4. Back in January I already covered this topic in an article called Arrays & shaders: Heatmaps in Unity. My original approach exposed an undocumented feature that allowed to pass arrays to shaders. Since then, Unity 5.4 has introduced proper support in its API. This tutorial replaces…

  • 3D Printer Shader Effect – Part 2

    3D Printer Shader Effect – Part 2

    This is the second part of the tutorial that will recreate the 3D printer effect seen in games such as Astroneer and Planetary Annihilation. This is a two part tutorials: A link to download the Unity package (code, shader and 3D models) is provided at the end of the tutorial.

  • 3D Printer Shader Effect – Part 1

    3D Printer Shader Effect – Part 1

    This tutorial will recreate the 3D printer effect seen in games such as Astroneer and Planetary Annihilation. It’s an interesting effect that shows an object in the process of being created. Despite looking simple, there are many challenges that are far from being trivial. This is a two part tutorials: A link to download the Unity package (code,…

  • How To Destroy an Arduino Board

    How To Destroy an Arduino Board

    Developers that are approaching electronics for the very first time have a lesson to learn; and this usually happens the hard way. Wiring a circuit incorrectly, and you can potentially destroy your Arduino board. When it comes to mistakes, hardware is generally not as forgiving as software. This tutorial shows the most common ways you can accidentally destroy an Arduino board; and how to…