Posts Tagged ‘Game Programming’

These posts are related to game programming.

Unity: Creating GUI transitions

Click here to read Unity: Creating GUI transitions

This Unity scripting tutorial shows how to manipulate the GUI system origin to create an animated transition, so you can make your GUI’s look more interesting. To keep things simple, this post shows how to create an horizontal transition between two Text Areas using a couple of buttons. All code featured below is available for download at the end of the post.

To achieve an animated transition, the origin of the GUI system must be manipulated. This is done by changing the elements of the matrix that sets the rendering reference point of the GUI elements. Conveniently, Unity allows us to do that by manipulating the GUI.matrix values. So, the script requires a Matrix4x4 object. Also, to make the code more readable, a Vector3 is going to be created, also making it easier to translate the GUI system origin. Here’s the script:
(more…)

Unity: Animated texture from image sequence – Part 2

Click here to read Unity: Animated texture from image sequence – Part 2

The second and last tutorial of a series that explains how to create an animated texture from a sequence of images in the Unity engine. This is a direct follow up of the previous post, so if you’ve missed it, please read it here. As the first post, the same disclaimer applies: for animating a texture with a small number of frames and/or small frame sizes, it’s better to join them into a single sprite sheet image and use this script. For video playback, use the MovieTexture (only available at Unity Pro).

Just as a reminder, this series is about creating an animated texture from multiple image files. In the previous post, a script loaded all image files into an array and then changed the texture of the game object it was attached to. (more…)

Unity: Animated texture from image sequence – Part 1

Click here to read Unity: Animated texture from image sequence – Part 1

This is the first tutorial of a series that explains how to create an animated texture from a sequence of images in the Unity engine. Before going into details on the script or the requirements necessary in order to make the animation work, please bear in mind that there are other alternatives available which will achieve the same results. For any animation with a small number of frames and/or small frame sizes, it’s recommended to join then into a single sprite sheet image and use this script. For video playback, please use the MovieTexture (only available at Unity Pro). However, if the animation doesn’t fit a 4096×4096 px image file, the script in this tutorial might be the solution.

(more…)

Unity: How to create a speech balloon

Click here to read Unity: How to create a speech balloon

This Unity tutorial explains how to create a speech balloon, like the ones featured on comic books, in Unity3D. For any game, objects move around the screen, and in order to make the speech bubbles work, they have to follow the movement of these objects. However, the balloon can’t be translated in the 3D space, or else it will look like a regular billboard sign over the character’s head. So, it has to follow the character on the two dimensional screen space. The elongated edge of the balloon must also follow the character’s movement, stretching and shrinking accordingly.

To solve these two issues, a script is necessary, which will treat the round part and the triangular tip of the balloon separately.

Speech balloon division

The script will create a speech balloon by rendering these two parts separately. They must have the same color to create the illusion that it's a single element.

(more…)

Unity: Slow Motion and Rigidbody behavior

Click here to read Unity: Slow Motion and Rigidbody behavior

It’s been awhile since the last Unity post, in fact, it’s been quite some time since there’s something new on the website. I want apologize to all the 41 Post readers for taking so long to put together a new tutorial. So, let’s get to the tutorial.

This post explains how to set the parameters found at Unity’s Time class to make the game run in slow motion (also known as “bullet time”). It’s important to note that the following code was created for Unity3D 3.4, thus, the code featured below might work different in other Unity versions. (more…)

Page 1 of 41234