Unity Rigidbody Interpolation Hero

Unity Rigidbody’s Interpolate property

If you looked at the properties available for configuration on a Unity Rigidbody and poured through the documentation for it, you’ll likely find that most of its properties are pretty easily to understand, with the exception of Interpolate and Collision Detection. We’ve explored what the Collision Detection properties do in another article on this blog, and we’re going to explore the Interpolate property in this article.

Unity Rigidbody's Interpolate
The Interpolate property has 3 possible values.
Continue reading
Apoca Force WAIFUs

Showing Unity’s NavMesh in-game

As part of a school assignment in the past year, my team and I created Apoca Force, a tower defense game where WAIFUs (World Apocalypse Intercepting Frontline Units) are deployed onto a battlefield to combat an undead horde. In this game, WAIFUs serve as the eponymous towers of the genre, but with a twist — by spending some resource, they can be moved after they are deployed.

To denote the areas that WAIFUs can walk on, we created an interface that highlighted walkable areas on the map when players decide to move their WAIFUs. This is what we ended up with:

Continue reading
Dust to Dust

Organising your Unity Inspector fields with a dropdown filter

Over the past 4 months, my team and I have been working on a rogue-like hack-and-slash game for our school’s final year project called Dust to Dust. We have very high ambitions for the game, and we had never worked on projects as large of a scale as this. Of course, by doing that, the challenges we encountered got bigger as well. We had to keep track of many parameters in developing a role-playing video game, and quickly realised that the time taken to find Inspector properties in the project was getting longer and longer. Furthermore, the project was on a 15-week timeline, so every minute was valuable.

Hence, we needed an effective solution that would ease navigation in the project, and — like before — it became clear that we had to once again extend the Unity Editor to suit our needs.

Continue reading
Unity Remote Splash Screen
Unity Remote 5 Android app splash screen

More tricks to get Unity Remote for Android working on Windows

28 May 2020: We’ve updated the article with some new details and 2 whole new sections!

This article is a continuation of Getting Unity Remote for Android to work on Windows. If you haven’t read that, I suggest you take a look at the article and make sure that Android Build Support (and its accompanying Unity-native SDK, NDK and JDKs) is installed, and that you have tried installing the Google USB Driver.

There are also some simple troubleshooting tips listed in that article that you should try first, before you attempt the ones here.

Continue reading
Unity Remote Splash Screen
Unity Remote 5 Android app splash screen

Getting Unity Remote for Android to work on Windows

30 July 2020: We’ve updated the article with helpful comments from past readers. Thanks for all your contributions!

If you’re developing a game for Android on Unity, Unity Remote is an irreplaceable tool that allows you to quickly test your game on your Android device using Unity’s built-in Play-in-Editor feature. Unfortunately, it is also pretty difficult to get Unity Remote to work, since it requires some very specific configurations on both your Android device and your computer.

Available solutions online are often incomplete, inaccurate, or outdated (Unity Remote was released more than 4 years ago, and the Android development scene is very different from how it was then), so you often have to piece solutions from multiple sources to get one that works. Hence, after recently grappling with getting Unity Remote to work on a handful of my own computers, I’ve decided to write an article outlining the most important steps for getting Unity Remote to work. Hopefully, this will save you from having to do over 9000 Google searches like I did.

Continue reading
GitHub Desktop
Image from https://desktop.github.com/

Using GitHub Desktop as your source control repository in Unity

If you’re working on a Unity project on the default, free Unity license, you’re only allowed to have a maximum of 3 people (and a storage limit of 1GB) on Unity Collaborate. While you can work around the headcount limitation by adding and removing members as and when they need to make a commit, it can quickly become a tremendous hassle. Hence, for those not willing to pay for a Unity license, a cheap and easy way to go around both the personnel and storage limit is to use GitHub Desktop for collaboration.

Continue reading
Ex-Terminator

Creating Reorderable Lists in the Unity Inspector

Update: Like this article? Then check out this other article on creating a dropdown filter for the Unity Inspector.

Over the last 5 months or so, me and my team have been involved in the development of a hybrid tower defense and RTS game called Ex-Terminator (click on the link to try it out, it’s free!) as part of a school project. During the course of developing the game, we quickly realised that, in order to allow us to have the flexibility to experiment with our level design, we had to experiment with a class in Unity called the ReorderableList.

If you’ve read some of the other articles here, you’d have noticed that we normally link Unity classes to its page on the Unity Scripting Reference. We didn’t do so here because there is no official documentation for it at the time this article was written. The ReorderableList class is filed under the namespace of UnityEditorInternal, which also doesn’t have official documentation. We’ve decided to write an article about it, however, because of how useful it is, and because of how little information there is currently about it online.

Continue reading
Unity Editor Scene view

Checking the type of GameObject you are colliding with in Unity

In any given game, you are probably going to find dozens, if not hundreds of different objects colliding or intersecting with one another. Hence, one of the first things you learn in Unity is how to identify the type of object you have touched. These are the most common ways to do so among beginners:

void OnTriggerEnter(Collider other) {
     // If a GameObject has an "Enemy" tag, remove him. 
    if(other.tag == "Enemy") {
        Destroy(other.gameObject);
    }
}
void OnCollisionEnter(Collision collisionData) {
    // If a GameObject has an "Enemy" tag, remove him.
    if(collisionData.collider.tag == "Enemy") {
        Destroy(other.gameObject);
    }
} 

Essentially, the idea is checking whether the object we are colliding with or touching has been labelled with an Enemy tag, before we perform any action on the object.

Where tags are assigned.
Image source: Unity Manual: Tags

While it is simple and easy-to-understand, there are better ways of identifying objects we are colliding with.

Continue reading
2D vector math hero - polar movement

Vector math for polar movement in 2D games (Unity)

Polar movement, i.e. moving objects at an angle, is something that people starting out in games programming often have trouble with. Coordinate systems are easy to understand, and so is moving things left and right or up and down; but what if you want to move at angles that are not parallel to an axis, like 30° upwards, or towards a target? How do you get a vector that represents that direction of movement?

Continue reading
Emission lighting in Unity

Getting your emission maps to work in Unity

Emission maps (also known as emissive maps) are textures that can be applied to materials to make certain parts of an object emit light (like the cube in the image above). In Unity, lights from emission maps don’t start affecting the scene as soon as you place them on the material. There are a lot of settings you have to get right in your scene and material settings to get the emission maps working right.

Continue reading