|05 May 2014|
Unity HUD / GUI Scripting
So I'm about to hit my head against the wall a few times because I am simply going nowhere with my project.
I currently have to create a simple HUD in Unity and implement 2 things into this HUD.
1) Make all of my buttons Clickable. They only need to change the way they look when the mouse presses down on them.
2) Implement a Hotkey for my Health and Mana bars to where I can make each one go down by a set amount when I press the key.
Here is my problem. I dragged a Maya Scene with all my objects over, and Unity is treating all of my individual objects, as one game object because they are all children of the Scene. Because of this I can't select any of them when it comes to scripting.
My images were saved as a .png file, and then put as a Lambert texture in Maya onto a plane. (all were set to have transparent backgrounds.)
As for my Buttons, I have two Planes for each button. One with an "Off" texture, and one with an "On" Texture.
Like I Said these are all Children of the "Scene parent" so None of them are actual Game objects.
Here is my code to have my Health Bar change when I press my Hotkey.
and if I could get the children to become GameObject's I assume a script such as this could work.
If you can help please do. This is a class Final and due to the fact that I had to drive 5 hours home to work this weekend I'm unable to actually go in and get help. =/
|reply share thread|