Kyle Banks

Filed Under #unity3d

There are many options for rotating GameObjects in Unity, but each has their own limitation. What if you want to have an object turn to look in a direction (left, right, down, up, etc.) or look at a specific world point, such as another object of interest, and you want to accomplish this dynamically at runtime and with animations so that your objects don’t snap to a new rotation but rather rotate over time?
The NavMeshAgent component prepares and NPC with steering properties like speed, acceleration and stopping distance, as well as obstacle avoidance parameters so you can finely tune your NPC behaviors. One thing that doesn't work out of the box is synchronizing with an Animator so you can have your character walk, run, and idle animations playing as they move about the scene. Keeping your NavMeshAgent and Animator*synchronized is pretty easy though, so don't worry.
Back in May I started a series of posts about a 2.5D platforming game I’ve been, or rather was, working on called Siren Song. This is a game I started back in March and while I’m pretty proud of what it’s become from a personal growth perspective, as it’s the most sophisticated game I’ve ever made, I’m sadly ending it where it is now.
As great as Shader Graph is, Unity is obviously unable to pack every function you could ever want or need into their graph. It's just not practical to expect that the tool is going to be able to solve every use case that developers can come up with, which means at some point you might end up needing to write your own functions.
Most everyone knows that publicly exposing your MonoBehaviour variables in Unity allows you to modify them in the Inspector window of the Unity editor. This is really helpful for tuning and adjusting parameters without having to modify code, and allows you to more easily reuse MonoBehaviour classes across objects where you may want different values. But how do you access private or protected properties?
In some of my more recent posts I began a series where I’d recreate effects from popular games using Shader Graph in Unity. The first of these was to create the static effect when a character receives damage in the excellent Axiom Verge. Well just a couple posts in I’ve decided to break from that theme and instead highlight some common effects seen in many games, without focusing on a specific game in particular.
Two weeks ago my wife and I participated in the GMTK Game Jam 2020, a 48-hour online game jam where the goal was to develop a game that fit a particular theme announced at the start of the jam. Over 18,000 people signed up for the jam and in the end over 5,400 games were submitted, making it the largest online game jam ever.
This post is a continuation of Sprite Shader Effects with Unity and Shader Graph, Part 1 where we started by creating a simple sprite rendering shader in Unity’s Shader Graph. If you’re already familiar with Shader Graph then I don’t expect you’ll need to go through Part 1 to understand what’s going on here. But, if you haven’t used Shader Graph or the new Sprite Lit Graph shader template, or just need a refresher, then...
Shaders, those mysterious programs that somehow instruct the GPU how to render objects and effects in our games, are a great way to introduce effects that make your game stand out from the crowd. However it can be quite daunting figuring out where to start and how to write even the simplest shaders. They’re written in esoteric languages and have a variety of peculiarities that make them difficult to pick up, but because they’re so...
It’s been about a week and a half since I first wrote about Siren Song, the 2.5D platforming/survival game I’ve been working on. Since then I’ve accomplished quite a bit, including a full rewrite of the movement systems, implementing the dive computer, tracking and limiting oxygen use with an exertion system, and a whole lot of work on adding in hazards like sharks, octopuses, fire coral, sea urchins, and more.

Siren Song, Devlog #1

May 23, 2020
It’s been a long while since I’ve written anything on this blog, but I’ve got a really solid side project going and figured it would be interesting to write about it. The project is a procedurally generated 3D platformer called Siren Song, where you play as a diver with ambitions to reach the deepest depths of the ocean.
A common requirement for 2D games is to have some sort of fullscreen background, be it a color, sprite, particle system, or anything else, to provide mood and aesthetic to the contents of your game. While a static color can be used to great effect, this post will go over the technique that I use for fullscreen background images in Unity using a standard SpriteRenderer and just a little touch of code to retain the original image's aspect ratio.
Frequently in Unity you'll see OnMouseDown used to detect clicks on GameObjects. This works fine but it requires a script on the GameObject itself, and may require synchronization within the game when there are many clickable objects.
While developing Byter for GitHub Game Off 2016, I wanted to allow players to pan and zoom the camera on both touch (tap and drag to pan, pinch to zoom) devices including Android and iOS, as well as using the mouse (click and drag to pan, mouse-wheel scroll to zoom) on the desktop and WebGL versions of the game. The camera for Byter has a fixed angle, meaning players cannot rotate it, but zooming and panning are important for collecting the *Lost Packets* in the game, and are a nice addition to allow interaction in a mostly static clicker style game.
GitHub's Game Off 2016 continues and it's now day 23 of the *Game Off*, and if you've been following along with my progress you'll know that a few days ago I published the first playable build of **Byter** at! From here on out it's all tweaking, tuning, and polishing.
It's Day 19 of GitHub's Game Off 2016 and it's time for the final stretch! I've actually published the first playable version of the game, available in the browser using WebGL, so please head over to and try it out!
It's just over the halfway point of GitHub's Game Off 2016, and I'm just an hour or so away from being *gameplay complete*, meaning there will only be polish and tuning remaining. I haven't made quite as much progress in the last few days as I had hoped (originally I had planned to be gameplay complete by now), however I'm still happy to be on track to complete the game jam in time.
Progress on my GitHub Game Off 2016 game continues, and with the halfway point of the competition approaching I've gotten to the point where the core gameplay is complete. Here's a look at some of the progress I've made over the last few days!
As mentioned in my previous posts, I've been developing a clicker game for GitHub's Game Off 2016. Today marks Day 9 of the Game Off, and I've managed to make quite a bit of progress.
At this point I've got the camera controls and core UI elements complete, as well as a JSON formatted game configuration file where I've defined some of the devices, storage units, and upgrades you'll be able to collect throughout the game. I've also got the bits spawning and moving along a path to the storage unit when you click or hold the main clicker button.
Yesterday the theme of GitHub's Game Off 2016 was announced, and the ideas is to build a game over the course of a month related to hacking, modding and/or augmenting. The announcement states that your game must be *loosely* based on one or more of these themes, but I've decided to go head first into the hacking theme. Considering how busy this month is for me (I would have loved for this to be a month or two ago) I'm going to have to keep it simple and try to get a playable prototype as quickly as possible before using any spare time to polish and improve the game.
Android Intents allow developers to share data such as text, images and URLs with other apps. This is handy for Share buttons, allowing users to tweet, post, email or message their friends from within your app or game.
Particle systems are fantastic for all kinds of effects in games, including fire, explosions, smoke, water, lighting, galaxy simulations, and much more. Unity comes with a built-in ParticleSystem library that can be used to implement these effects in your 2D or 3D Unity game.
When discussing performance optimization of Unity games, be it 2D or 3D, object pooling is a commonly referred to technique to gain significant improvements. An object pool is essentially a set of pre-instantiated objects that can be recycled when they are no longer in use, and eventually reused as required.
Unimation is an open source project I've been developing that aims to make animations in Unity 2D and 3D projects simpler.
Having the Camera follow the player character is a common requirement for many types of games, so I thought I'd share a helpful trick to ensure the camera follows the player smoothly and fluidly.
Unity with Git and GitHub seems to be a little mysterious to some game developers, so I thought I'd share a video demonstrating how to use Unity with Git and GitHub.
A game that takes place in space may want to disable gravity for instance, while a platforming game may want to inverse gravity for a particular level or even on-the-fly with a power-up to walk on the ceiling. However you need gravity to behave in your 2D or 3D game, its as easy as a single line of code to make it happen.
It's a pretty common requirement in game development to need to know if a particular character or object is on the ground. For instance, your player may only be able to jump, attack, or interact while they are on the ground. A common way to check this is to use a Raycast, which essentially allows you to detect the distance between to physics bodies.