Monday, January 17, 2011

More stuff I've been working on in Unity

Alright so I wanted to do more in Unity. So the main goal of what I started out with is to learn the new things about Unity 3 and find out more about Character making.  I found a really cool tutorial on making characters.  Unfortunately, you have to do this whole long tutorial in order to get the scripts and everything you need to make the characters.  But it turns out thats alright because the guy doing the tutorial is using Unity 3 so I am learning new things about Unity.

The first thing I learned about is Unity now has a built in 3rd person controller and 1st person controller.  So we no longer have to build everything do control a character.  In the first tutorial I was able to learn more about the GUI interface which confused me a bit last semester.  Now I'm getting down into what exactly it is and what it can do.  I was able to make a simple health bar that looked pretty good.  I wish I would've known about it last semester so I could show Russell because it would have helped his game.

This is a picture of the health bar.  It was hard to get t bigger, but I hope you can see it.
I wish I could put up all the code I did but thats a lot so I'll just put up the important parts:

//This is the magic!  This allows you to make a bar that grows and shrink really fast!
GUI.Box(new Rect(10,10, healthBarLength,20), curHealth + "/" + maxHealth);

The healthBarLenght is updated with this code:
healthBarLength = (Screen.width / 2) * (curHealth / (float) maxHealth);


The next thing I found out about was the Unity tagging system. This will uniquely identify an object based on the tag (allowing you to use the name the same as the prefab).  This would have helped me tremendously last semester with my penguins!


I also learned some debugging tools.  We learned some of this last semester, but this helped because I actually got to use them.  One of the debugging tools was drawing a line between two things in the actual game, which will help a lot.



No comments:

Post a Comment