Matter can exist in any one particular form called a state. In our everyday lives, water is probably the most familiar representation of this with each of its three states being ice (solid), water (liquid), and vapor (gas). Each of these states have their own defined characteristics, and in order to transition from one to another, certain conditions must be met. These conditions are influenced by outside forces (e.g. temperature) and may also limit which state matter can transition to from its current state. …


Objective: When an object’s OnTriggerEnter() event is raised, reduce it’s health based on the specific object it came in contact with.

One of the primary pillars of OOP, polymorphism, allows an object to implement a particular behavior while allowing the performance of that behavior to vary between objects. For example, dogs and cats are both animals which can speak, but when speaking, dogs will bark while cats meow. Interfaces are a great way to accomplish these behaviors across objects and create cleaner, more manageable code.

In my scene I currently have three objects which each interact with one another. An…


Like many people fortunate enough to have them, LEGO was the keystone to all aspects of my childhood, from early elementary school through high school graduation. Hours spent building, organizing, and playing would often turn into even more hours spent rebuilding, reorganizing, and replaying, each time feeling like only mere minutes had gone by.

Unfortunately, as time passed, so too has my own collection dwindled. However, through Unity and BrickLink’s Studio, sets, worlds, and the imagination that fuels them can be revitalized in an all new experience.

Studio is a free CAD-like application which is integrated into BrickLink’s LEGO parts…


Like us, sometimes game objects just need to get away, whether it be from each other, our player, or our player’s missiles, sticky grenades, and vehicle roadkills. Similarly to the seek steering behavior discussed previously, flee provides those game objects with the means to steer towards a specified location. However, instead of the location being aligned with a target, it’s positioned away from the threat, simulating an escape.

The same velocities and forces (current, desired, and steering) are shared between seek and flee, and each velocity/force still functions the same except for the desired velocity as shown below:

Current velocity…


In Unity, one of the most basic movement functions we’re all fairly familiar with involves taking the float values from our WSAD inputs, applying those values to a direction vector, and then using that vector, combined with a speed variable, to affect the transform of an object that we want to control.

Yes, it’s that simple! (Optimization NOT included)

With minor changes to the direction vector, this simple function can also apply to autonomous objects, but unfortunately, the straightforward nature of this code is also its downfall. Mainly, there’s no account for rotations and the movement is rather unrealistic, among other things.

Fortunately, Craig Reynolds’ 1999 paper…


Using a graph is one of the best ways to visualize and present data for users because it allows them to more easily identify trends, abnormalities, areas of concern, and just generally better comprehend the data they’re working with. If that data involves any type of variation over time, like a health application tracking users’ progress or a game allowing users to track their economies, then most likely a line graph will be your best bet for displaying those changes in information.

Like the x and y-axis of the Move gizmo in Unity, a line graph is made up of…


Amazon Web Service (AWS) provides on-demand cloud computing platforms with various tools for various services. One of those platforms, Amazon Cognito, specifically provides a means to authenticate, authorize, and generally manage users for your application either directly through Cognito or through another federated identity provider (IdP) such as Google and Facebook. The basic workflow for a user accessing his or her account through Cognito or an IdP is as follows:

1. User begins using the app.

2. User is authorized and/or authenticated by a user pool directly through Cognito or a third-party IdP.

3. Authenticated user receives access tokens.

4…


In Unity, we primarily know Vector2s and Vector3s as a way to represent and modify 2D and 3D positions, directions, and Euler angle rotations in our scenes, respectively. However, these vector representations also include functions which allow us to execute common vector operations, including the dot product.

Like our own vision which may be limited by where we’re facing, what we’re facing, how we’re facing, or (semi-spoiler alert!) whose Hex we’re in, the vision and line of sight of game objects may also need to be limited once defined. Per the Wiki, the dot product is the product of the…


Garbage collection in our everyday lives is generally the same as garbage collection in your program. You purchase an item from the store and make room for it in your home (instantiate a new game object and allocate space in memory), get use from that item (game object, do this thing), toss out or recycle that item once you’ve used it all or it breaks (sorry game object, you’ve been destroyed), and, finally, your trash is automatically taken away by the indispensable neighborhood waste collector, clearing room for your next purchase (the memory allocated to that game object is released…


For those familiar with announcements being broadcast over a school-wide PA system, that method for distributing general information is lightyears more efficient than individually updating each grade, each class, and certainly each student. Although sometimes annoying, this method of providing updates allowed those who may have been interested to tune in and react on what was relevant to them, while others were able to simply ignore the message and go about their business. Also, it didn’t matter who was making the announcement nor what time the announcement was made, the information was passed along all the same.

Using delegates and…

Ben Mercier

I’m an emergent software developer with a longtime love of games and a growing understanding of how to actually build them.

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