Skip to main content

Posts

Showing posts from June, 2011

Where To Host Your Unity 3D Game

Since I've been busy with a new game and other stuff I haven't bothered much to explain stuff. Been trying to learn some more but haven't quite gotten anything useful yet. Anyway, if you have a ready webplayer game you want people to play but you don't know where to host it, Kongregate is a nice place.



Creating Characters (Blender 2.57) [Version 2]

Second way to make characters, this time a little more complex.  This will involve using child/parent relationships.  I'm not going to go into much detail, for more information, read previous posts.

Blender 2.57 exporting :D

We worked out the bug with Blender 2.57 and exporting.

I'm going to go ahead and show you how to export.

So, go ahead and once you're finished creating you're object, go into object mode, and select the entire object.

Got that done?  Okay now go to file and to export, and if you're exporting to Unity 3d, select the .fbx autodesk file, and just save.  You can then open up the object in unity.
Please accept my apology for unintentionally misleading you about Blender 2.57 importing/exporting abilities.  I will be going back to 2.57 tutorials, however, if you would like me to also do 2.49 tutorials, email the blog and I will strive be diverse in the Blender program interfaces.

Blender 2.49, setting up

Okay, so I have just now installed Blender 2.49, and I have to say, though it looks similar to 2.57, I'm having a hard time navigating around.  I'll do my best to help those who've also taken the liberty to download 2.49, and also I'll try to coordinate it so it's easy for those still using 2.57.

Blender

Due to importing/exporting problems with Blender 2.57b 64bit(stable version) between Unity3d, I will be switching to an older version of Blender, Blender 2.49, which apparently cooperates with Unity.  As far as tutorials goes, I will be trying my best to make sure that everything is coordinated correctly as far as using functions, modifiers, meshes, texts, objects, etc.  If you are also having problems with Blender 2.57 and would also like to install Blender 2.49, I will provide a link here  (http://download.blender.org/release/)

'Building' Your Game

**A brief overlook**

Unless your games only going to be made up of 1 scene, your going to need to mess with your build settings.
Start with going to:
File>Build Settings...
or by pressing Ctrl+Shift+B

















Scenes In Build contains all the scene that will be made in the game when you click build. The number next to the scene name is how you would reference in the script.

Platform window contains all the platforms you can build for. XBox360 and PS3 need contracts though. I don't know how to obtain those. The default platform when you start a new project is PC and Mac Standalone.

Released our first game XD

It's pretty pathetic. But it's on Kongregate.com. links here. A screen shot:

Making music.

Well. I found a nice little site that will let you create your own music for free. Then download the music file to your computer. Not a cent. Unfortuantly everything I make sounds all techno XD But it can be useful. There editor looks like this. You don't even have to download it. It just loads right in your browser



Here's the link


Unity's Available Prefabs.

Unity has on their site free packages and extentions you can download and get amazing prefabs. Such as this explosion prefab.

Collision/Trigger

An overview of how to use OnCollision and OnTrigger functions.
Which almost all games have. Ha..

Child-parent relationship in Blender 2.57

Child-parent relationship is a confusing concept to understand and master, but important at that.  What a child-parent relationship is is that it "links" thing together without joining the objects into one.  This is good for when you have such things like humanoids when you want a singular part to move, but the entire creation.  (ex: parent: torso; child: arm; whatever the arm does will not affect the torso, however, if the torso rotates, the arm will rotate with it)

Building a landscape Blender 2.57

Landscapes are useful, and building one can be difficult  This will just be a simple how to on making landscapes

Materials and Textures Blender 2.57

Adding materials and textures is an important aspect of creating models and characters.  I'm sure that some of you  (like myself) add a texture to a model and it didn't apply.  This will be me showing you how to add textures and designs to objects.

Tags ^.^

Small Tip...

Something that has been helpful to me is tags. What you do is set a game objects tag to something specific, to access them easier in a script. To set a tag, simply select the game object and in the inspector pane, click and select =D that easy.















Text to Mesh Blender 2.57

Most people who use Blender use it for game development (as this is how we are using it)  and many game developers may not just want flat text as their logo.  This will be a tutorial on how to convert regular text to a three-dimensional mesh.  (I would recommend reading my blog about hot keys if you are new to Blender here)

How to Instantiate!

When you instantiate something, you clone it, put it in the position you want, and the rotation you want. A very simple command. Done like this:

function Update(){
    Instantiate(transform, transform.position, transform.rotation);
}

So basically what this script does is clones what ever the script is attached to at the position of the object, and its rotation. Not really the best thing. Better yet it's in the Update function, which is being called every frame thats rendered, so thats allot of clones ha..

Don't Destroy On Load..

So if you want to keep an object or script that keeps up variables (or for any other reason) when you go from scene to scene, you need to attach a don't destroy on load static function, which goes something like this:

function Awake () {
    DontDestroyOnLoad (transform.gameObject);
}

The Awake function is call only once, when all the objects in the scene have been created. Read more about it here.

DontDestroyOnLoad has what ever is in the ( ) to not be destroyed when creating a new scene.

(transform.gameObject) is what will not be destroyed when the new scene is loaded, in this case, it will be the game object and all it's children the script is attached to.

Blender Hot keys and Using Blender

This will show you how to use Blender and also the hot keys.Hot keys are very important (and simple) in Blender.  They make navigation, distortion, editing, toggling, and other things much easier than if you were to search for each individual function on the software.  I'm going to go over most of the hot keys and their functions.  (This is for Blender 2.57, hot keys and functions listed below may not work/coordinate correctly with older or newer versions of Blender)

Creating Characters (Blender 2.57)

One of the (if not the) most important aspects of a game is the characters.  But another thing about characters is that they're hard to make.  This will just be a quick tutorial on how to make characters

Referencing another script..

So, here's how it's done.

function addingExp(){
var level = gameObject.Find("Player").GetComponent(Level);
    level.experience +=50;
}

Explanation:


gameObject.Find("Player")
 Finds the object the script it attached to. Player is the name of the object, note that the name has to be in quotations.

GetComponent(Level)
Finds the name of the script.

level.experience +=50;
level is calling the variable that we just set above, experience is a variable within the script that were calling on in the code.

What Is A Float And Integer?

Float is short for floating point which is a decimal value (example: var three : float = 3.14.

An int (integer) is a number without decimal (example: var three : int = 3. Basically they are the two user variables used together with calculations. Basic text is called a string which is set by quotations (example: var three = "3". To convert between them you can use: numberVariable.ToString() parseInt(stringOrFloatToIntVariable) Mathf.RoundToInt(floatToIntVariable) <- (this one has lots of options)
Special Thanks to save

Making your materials A little more realistic.. (Normal Maps and Bumped Diffuse)

How to go from this:











To this:











GUI Basics

So every game has some type GUI (graphic user interface). The best way (as I see it) is scripting the GUI.
Very simple, so something easy to start with:

function OnGUI(){
GUI.Box(Rect(10, 10, 90, 90), "Hello!");
}

Rect - Shape the box will be, rectangle.

(10, 10, 80, 90)
10 - How far away it begins from the left of the screen.
10 - How far away it begins from the top of the screen.
80 - Total width of rectangle.
90 - Total height of rectangle.

"Hello!" - Text that shows up in the box.

Input Character Controls?

When creating controls for your players to use, It's needed (or really just helpful) that you modify your Input settings.