- Home /
Showing a Rotateing 3D Item "In" or "On" the GUI
Hello, I'm creating a system where when the player hits certain levels they can unlock items. What I want to do is when they pick/choose or what ever the item to unlock, the item will be show in the middle of their screen rotating with a GUI Texture over it. Any ideas would be great I can't even think of how to start.
Thanks, Hans, The Unity Newb
Edit: I need to create a pop-up underneath it as well. Something like a GUI.Window.
Answer by WilsonS · May 09, 2011 at 03:48 PM
As far as I can tell (and I have spent quite a while looking), Unity GUI does not have a sprite rotation function. This does not mean you are out of luck in the rotation department. You can attach a sprite to a GameObject and rotate that object in the 3d World.
The simplest method would be to attach the sprite to an box that is childed to the main camera. However this GameObject would be subject to all sorts of strange lighting effects if your camera changes angle in the world.
The better method is to create a secondary camera in an unused part of your scene, Then put your rotating object in front of that. You will have to play with the culling mask and clear flags camera properties so that both cameras will render what you want to the screen. I don't remember the settings I used, but it is very doable.
If you don't feel like messing around with all this, you could do all the rotating in your image editing program and cycle through the frames in your GUI script.
Yep the second approach worked nicely, the secondary camera tricked work well. I just ended up making 3D models of the need items to rotate so they look really nice now ty!