Creating HUD in Unity 3D

Creating HUD in Unity 3D

Advertisemen

Check out our YouTube Channel - Aarlangdi dotKom for short films


There are two ways to create HUD in Unity 3D, so far I know, if you guys know other ways, please leave comments below.

Ok, first method, using GUI.Box(new Rect(0,0, Screen.width, Screen.height)); or some other built in functions in unity, you can take a look in script reference under GUI for more information.Problem with this is, when you compile and run it in iPhone device, you can click through it which we don't want that but it is ok when you run in unity editor. May be this a bug in current version of unity 4X.

Let's take a look at custom method to create HUD.Create a texture with 50% opacity or so in photoshop and drag into Unity3D. Now, create plane in hierarchy and give it rotation of 270 in x position so it stands up vertically. After that, drag texture we created into it and make sure its material set to Transparent/Diffuse. take a look a setting pictures.Left hand side is settings for plane we created and right hand side is setting for transparent texture we created in photoshop and brought in unity.

separator" style="clear: both; text-align: center;">
Now, create some cubes and pull the plane with transparent texture in front of them so we can test it. You can go ahead and apply drag and drop behaviour in these cubes, how??? you can take look my drag and drop in unity tutorial.

After all these, create C# script and attached it with camera then type followings in the script.




what this script does is, moves the plane from the top of cubes when timeValue gets to 0.



Go ahead and test this in iPhone  device, it should work fine.

Hit like, subscribe and share with others, if you find this tutorial helpful.
Thank you..........

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D