Unity3D: Non-rectangular GUI buttons – Part 3
Posted by Dimitri | Jan 17th, 2011 | Filed under Featured, Programming
This is the last post of this series, which explains how to create non-rectangular GUI buttons for Unity3D games. If you haven’t read any of the other posts yet, it is highly recommended that you take a look at part one and part two before going any further.
So, let’s start from where the second post left: we already have our Unity3D scene set up with the 3D hit test model already imported and placed inside the scene. All we have to do now is import the PNG images and make then appear as a GUI element. To do that, just drag and drop then somewhere inside the Project tab. After the images are inside Unity3D, create a GUISkin by right clicking an empty space in this same tab and select Create->GUISkin as shown: Continue reading: “Unity3D: Non-rectangular GUI buttons – Part 3”
Unity3D: Non-rectangular GUI buttons – Part 2
Posted by Dimitri | Jan 15th, 2011 | Filed under Programming
This post series explains how to create non-rectangular shaped buttons in Unity3D. This is the second part, so if you missed the first one, it is almost required that you read it here. The first post explained how to set up the 2D image, and then, make a 3D model out of it to serve as hit test area. This 3D model is necessary because we are going to use Unity3D’s Raycast collision detection do make the buttons.
This post will explain all the steps necessary to prepare the Unity3D scene to receive the non-rectangular GUI code.
Continue reading: “Unity3D: Non-rectangular GUI buttons – Part 2”
Unity3D: Non-rectangular GUI buttons – Part 1
Posted by Dimitri | Jan 14th, 2011 | Filed under Featured, Programming
Unity3D is a great tool to make games, but sometimes we encounter some limitations like the hit test area of the GUI buttons: they all have to be rectangular. This post series shows how to overcome this limitation letting you create GUI buttons that can have any shape.
It will cover it all, since the initial operations required to export the button’s PNG file from the image editing software, to the code at Unity3D. So, the post series will be divided into 3 parts, that will cover all the necessary steps.
In this first post, everything that must be done outside Unity3D will be explained. You will need a image editing software (like Photoshop or GIMP) and a 3D modeling software such as 3D Studiomax or Blender.
Continue reading: “Unity3D: Non-rectangular GUI buttons – Part 1”
Android: touchscreen ‘swipe’ movement detection
Posted by Dimitri | Jan 11th, 2011 | Filed under Programming
This post explains how to code a simple swipe screen movement detection that can be used to control characters and other objects on an Android game or any other application.
All this code is written inside the View class, so open it up and let’s get to it. The first thing we will have to do is to create four different variables: one pair will store where the screen was touched, and the other one will be used to store the difference between the location where the screen has been pressed and where the screen has been released. Create this variables and assign zero to all of then, like this: Continue reading: “Android: touchscreen ‘swipe’ movement detection”
Unity3D: Troubleshooting Rigidbody problems
Posted by Dimitri | Jan 7th, 2011 | Filed under Programming
Maybe the component that give Unity3D developers the most number of headaches is the Rigidbody. Sometimes it doesn’t seem to not work the way it’s supposed to, although these problems are mostly caused by wrong parameter values and settings. That’s the main reason behind this post: to point out the most common problems encountered when using rigidbodies in Unity3D.
Before listing these problems, keep in mind that the Rigidbody is part of the physics simulation in Unity3D which is decoupled from the game logic, and that’s why there is a separated Physics Time Step and a different method dedicated to it- the FixedUpdate() method. And before trying to figure out what the problem is, check the basics and see if all GameObjects the Rigidbody collides with have an attached Collider component, or if some parameter is set too high or too low.
Continue reading: “Unity3D: Troubleshooting Rigidbody problems”