Variables

If I were data modeled by a computer, there would be variables which describe me including one to reference my name (a value which hasn’t changed) and my age (a value which does change every year). Some variables could only be determined by me, such as the name of my favorite movie, and others might be controlled in whole or in part by external sources, such as my marital status. All of these kinds of relationships can be modeled in code when you know the right vocabulary. In this lesson, we will create a class which implements the example I just provided, and then we will use our understanding of variables to animate an example solar system, all with a single easy script. Continue reading

Your First Script

If you’ve never created a script before, don’t worry, it’s not exactly rocket science.  Learning to program is like learning a new language, but you are “talking” to the computer.  Just like a human language can be broken down into sentences which consist of a noun and a verb, programming languages can be broken down into variables (the noun) and methods (the verb) which are often paired in statements (the sentence).  Learning to program simply requires a bit of effort to learn the vocabulary and then to put it all together in a logical way. Continue reading

Learn C#

This tutorial series is designed for a quick introduction to programming in C# using Unity. It will briefly introduce most of the language features, but from the perspective of use within Unity rather than general use cases, and hopefully therefore will be more interesting to learn from. I will be writing with the assumption that you already have Unity and have a basic understanding of the program. Continue reading

Dynamic Animation Part 1

Unity has some pretty decent animation abilities built into the engine with which you can keyframe the position of entire hierarchies of objects. If you were animating a walk cycle or a bouncing ball, it works great. Other common use cases, like animating the move of a UI element when supporting multiple screen aspect ratios, are another issue. When you don’t know what the size of your screen will be, you can’t keyframe an animation for it. There are plenty of plugins on the asset store which solve this problem, but if you are like me and want to know how it all works, or you simply don’t want to spend money, read along and we will create our own solution. Continue reading

World Implementation

I stumbled across a great resource awhile back at http://opengameart.org. You can find a large assortment of assets for game development including art and even music, and as the name implies, you are free to use most of it in your projects. This coupled with the enjoyment I had with the random world creator I made in the last post and I have decided to move away from the purely text based RPG. It will be easier than I thought to add some graphics, so in this post, I will show how you could extend the Procedural World Visualizer into a sprite based equivalent. Continue reading

Procedural World Visualizer

As a single developer without a team of artists to create hand craft level content for me, I am considering creating my RPG’s world from Math. In this tutorial, I will create a means of visualizing such a world to show just how flexible and easy to use it can be. We will be making heavy use of Perlin noise, but don’t worry, this post will actually be light on math. Continue reading

Social Scripting Part 3

Welcome to the final post of Social Scripting. As a quick recap, Part 1 discussed several “Social” architectures offered by Unity, such as their Messaging system (both the legacy version and new version) and their new EventSystem. Part 2 discussed purely C# options including delegates and events.

The goal of this post is to create a custom Notification Center, which combines several features I like from across the board while adding a few new possibilities to boot. Continue reading

Social Scripting Part 2

In Part 1 of this series we discussed several means by which Unity allows you to get your scripts talking back and forth between each other. That included direct references, their legacy and new message system, and their new event system as well.

In this post we will examine the options available to you as a language feature of C#, just in case you don’t want to rely on the options Unity provided. Although their event system is quite powerful and easy to use, keeping your events native will allow your code to be more easily reused in other projects or ported to other engines. I consider this part of the series intermediate level, and will expect you to have a working knowledge of C#. Continue reading