Press "Enter" to skip to content

Category: Unity3D

Data Serialization Part 2 – Unity3D, Json.NET, and Twitter REST API

Why Json.NET? Unity does now include a Json utility, but it falls flat in many cases. It doesn’t serialize nested classes well (classes with multiple levels of inheritance), it can’t rename the Json object’s variables to something more appropriate for your code base, and there’s really not a lot of options. However, it does claim to be “…significantly faster than popular .NET JSON solutions…”. One of my favorite features of Json.NET is that it can easily serialize private fields and public fields with private setters. This allows for maintaining access restriction in you code base’s models without requiring the use…

Leave a Comment

Implementing Touch Controls in Unity 3D

Throughout the ages games have been controlled in a variety of ways: joysticks, gamepads, mouse & keyboard, and many more! With the advent of mobile devices new styles of input have become available to us, namely touch screen controls. In this tutorial you’ll learn how to implement two different styles of touch input in Unity: Virtual joystick: This is where buttons on the screen that are similar to a gamepad or joystick are used. Direct interaction: This is where the player directly interacts with objects in the game to control their movement, firing, and other actions. Unity makes it incredibly…

Leave a Comment

Saving Data in Unity 3D (Serialization for Beginners)

With games we almost always need to save some data: scores, inventory, progress, preferences, etc. There are many ways to do this in Unity. In this article I’ll take you through a few different ways to save data and hopefully encourage some good habits when structuring your applications for saved data. There are two main levels of persistency for data: Session Data¬†(data doesn’t necessarily need to be remembered the next time you load up the application): This is usually done via static variables and is used for only values that matter for the current session. Most commonly this is for…

5 Comments

Unity 3D Tutorial – Procedural Map Generation – Beginner Level

Procedural Generation is one of the most useful and complex practices in game programming. It’s often difficult to get into because it’s quite abstract which can make it difficult to grasp. It can also be quite time consuming to experiment with and there are many different ways to get the results you want. It’s extremely useful because it can help us to generate nearly endless amounts of content on the fly. It can be used in level designing where you don’t want to generate the levels on the fly, but instead want to predetermine your levels. In this tutorial we’ll…

Leave a Comment

My Unite LA 2016 Experience

Hi everyone! I’m finally an official Unity Certified Developer! I just returned from the Unite LA conference and a short vacation, and I thought I’d share some of my highlights with you. I decided to go to Unite LA for multiple reasons: I really wanted to be a Unity Certified Developer, going to LA would allow me to meet face to face with one of my best clients, and I was hoping to meet some like-minded developers. Mission accomplished on all fronts! Plus my wife and I were able to have some time to explore LA. This was my first…

Leave a Comment

Unity3D Certification Courseware Review

Hi everyone! I’ve been prepping for the Unity Certification that I’ll be taking at Unite LA next week. For preparation I decided to work through the Unity Courseware. I received 30-day access to it for “free” when I subscribed to Unity Plus so it was a double win! I figured that I should review it as well so that others know what they’re getting for their money. Please note that I’m sure they’ll be making improvements in the future, so this review may/may not be valid in a few months. You have multiple options to rent the courseware. The cheapest…

2 Comments

Diagnostics

Ever have a bright idea and think to yourself “oh, man, this is going to be so much faster”? Well, I do often, and often I find out that I’m a dummy. But that’s OK! We need to learn. So how do you find out your bright idea is as bright as a black hole? Diagnostics. The tool I tend to use most is simply the Stopwatch provided by the System.Diagnostics namespace. It’s pretty simple and provides that much-needed insight to the age-old question: “Is this method better than that method”. In this article I’ll take you through a couple…

Leave a Comment

Quick tip: Using Unity Actions to set default states on objects

So as I was working on a project that has a bunch of UI panels I kept forgetting to disable certain panels before running the game or before committing it and my client would see the panels with the loading screen. Sure I could add a line to the controllers I have set up to set the default state, but there’s a bunch of controllers, not all of them have the panel assigned to them at start, not all of them are disabled (some are alpha 0, some are scale 0), and it’s really best when an object maintains its…

Leave a Comment

Unity 3D Tutorial – Custom Transform Inspector

Hi everyone! One of the awesome things about Unity is you can customize the editor to add all sorts of cool functionality. This article will show you how to override Unity’s transform inspector with a more useful customized version. The Custom Transform Component includes: The ability to view and edit the quaternion rotation (nice for experimenting and learning how quaternions work). The ability to show the local axes in the Scene view even when the object is not selected. Some special operations for aligning to other objects, random rotation, random scale, and random position. Here’s what the final product will…

Leave a Comment

Unity 3D to IBM DB2 Connection Tutorial

I recently had the challenge of connecting to an IBM DB2 database via Unity. After some struggles with setting up DB2 and getting the user access all correct, it ended up being fairly easy. This quick tutorial will show you how to do it and point out some of the pitfalls you might encounter along the way. Step 1 – Set up IBM DB2 To try this out you’ll need to be able to connect to a DB2 database. I didn’t have access to any so I set one up on my Windows 10 PC. Any of the DB2 installations…

Leave a Comment