Tutorial: How to create a timer in Unity 3D with JavaScript in Unity 5

This short written tutorial is aimed to show you in a few easy steps how to code a timer in Unity 3 D.  You can easily modify the script by doing minor changes. This tutorial will make use of the new Unity UI System that was introduced in Unity 4.6f. Its also tested with Unity 5 and works just fine.
Continue reading


[Quicktip] How to limit InputField to numeric values

Recently there was a question on Unity Answers about how to make an input field that only allows numeric values to be filled in. The solution is quite simple, especially if your making using of new UI stuff thats available since Unity-Version 4.6.

So let me show you how you can do it!

Continue reading


How to extract game assets from unity android game

I recently came across our ball in maze apk file. I was very eager to make some improvements but unfortunatelly somebody must have deleted my Unity project. So I asked my self how to extract an android game made with Unity to get most of the Unity projectfiles back. Essepecially the .assets files as they took the most time to create. This is also a commonly asked question on the internet. Though I could not find a helpful answer.

It’s actually much easier than you’d expect. 😀 In the following article I’ll show you how to do it.

During my research I came across a script that allows you to retrieve mesh data from .apk files. That means you can partly restore your Unity-Project by using an .apk Android file as a basis. According to the developer the extraction scripts also works with Web, PC, iOS, Android, PS3, Xbox 360, OSX and Linux games. As I only have an .apk file, I wasn’t able to test out the compability of other platform types. But as long as the code is structred in a similar way, you should be able to obtain game assets like meshes and textures from PC-games etc as well. One thing to keep in mind is that the location where the assets can be found, may be different. Please read this article for extact information about your platform. Tell me about your experiences in the comments. 😀

It works with any Android game created with Unity.

Continue reading


How to randomly choose an Element of an Enumeration C# Unity3D

Unity quick tip

I recently had the problem that I was working with enumerations and at some point I wanted to choose an entry randomly from my Enumeration. In the following I would like to show you how you can solve this task.

Thats how my Enumeration looks like:

	public enum Direction : int{

The main problem is that the default classes don’t offer a method for getting the length of an enumeration thats why we have to add the System namespace at the top of the script.

using System;

The following function is now returning an item randomly from my Enumeration Direction.

	private Direction RandomDirection(){

		return (Direction)(UnityEngine.Random.Range(0, Enum.GetNames(typeof(Direction)).Length));

Thats it for this quick tip. I hope that it is useful for you! 🙂

Cheers Alex


How to load text for GUI from the Internet in Unity 3D


Gioacchino Giuseppe Serangeli [Public domain], via Wikimedia Commons

In this short article I am going to show you how to load text from the internet in your application created with Unity 3D. That means with the help of this short guide you will be well prepared for loading the text of GUI Labels etc. from an online hosted .txt file. We will write scripts, which allow us to turn a URL to a document into a text. 🙂 Continue reading