Once you’ve created a version of your application in Unity you want to be able to test or share without having to have Unity open, it’s time to build the application to an executable file.

Doing so is simple, clicking file →build settings will open the build window where you…

To play an audio clip in Unity, you only need to add an “Audio Source“ component to a game object, enable “Play On Awake”, and drag the desired audio clip into the AudioClip field.

To play an audio clip through code, in a response to something happening in the app is not much more complicated.

First you need a reference to an audio source.
Here I placed my audio source on a separate game object and dragged it into the open field in the inspector.

To start working with post processing in Unity is simple, go into the package manager (window — package manager), choose Unity packages in the packages dropdown menu, and hit install.

Once the package has been installed, return to your hierarchy and create a new empty game object, and add the…

Usually when making a video game that needs to visualize player health, a health bar or lives counter is the simple and generally reliable way to do it, but it’s also not very interesting to look at.

So lets create some visualization for the player model being damaged.

Here is…

Any good game needs explosions.
But how does one make an explosion in Unity?

With animations of course!

GamedevHQ provides a custom explosion animation for the enemy character in their 2D game course. …

Once you’ve created some basic gameplay for your game, you’ll probably have to be able to either restart because you lost, or go to the next level.
This is where the LoadScene function comes in.

Taking either and int, for the sceneBuildIndex, which you can see in the build settings…

As part of the GamedevHQ 2D game course I was tasked with creating a retro game over screen. So, a great big text box saying “GAME OVER”, but to add some spice, make it flicker on and off.

First I need the great big GAME OVER text, a simple UI…

Building UI in Unity is amazingly powerful and easy.

Start by right clicking in the hierachy, go to UI, and select Canvas

In the Canvas game object you’ll find:
A Rect transform, a sub type of transform that all UI elements use.
A Canvas defining how the canvas is integrated into the…

When writing a program, if statements are a powerful tool for branching code, but sometimes you need to make a lot of individual checks on a single variable, and filling up 100+ lines of code with “if else” statements is at best unappealing.

This is where switch statements come in…

Animating a sprite in Unity is wonderfully simple to implement, once you have the art.

Here is the speed powerup from the Gamedevhq 2D game course. It’s got the first frame of the animation I want to give it, set in the sprite renderer.

Kasper Møberg Rasmussen

Masters graduate of Learning and experience technology from University of southern Denmark, with a passion for the future of interaction.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store