- Home /
The question is answered, right answer was accepted
Display a 2D image over my 3D scene
Hello!
I'm just beginning with Unity and I'm new on this forum. I've read all the manuals and tutorials I could find, but I still have a few problems so you'll see me around in the following weeks, when I'm stuck :)
My first question is maybe very straightforward but I couldn't find how to do it.
I'm making a game where I have a 3D scene (say, a FPS map), and I want to display a 2D overlay (for example, the hand holding the gun), like in Doom 1.
My hand+gun image is a pixel-art image and it's exactly 50*50px. My resolution is fixed too: 960*600px.
I'd like to display this image on top of everything, at its native size, and centered at the bottom of the screen.
Is that possible? How?
Thanks a lot for your help!
Max
Research:
GUI.DrawTexture()
GUITexture
Quad (parented to the camera)
Quad displayed by second (probably Orthographic) with a higher depth and using layers.
Sprite (setup like the previous two points).
These are the common ones that do what you are asking. There are pros and cons to each. And there are others as well, like Graphics.DrawTexture() and GUI.DrawTextureWithTexCoords().
Thanks! The problem was indeed that I didn't know what to search for :)
Answer by xem · Jul 28, 2014 at 04:24 PM
Okay, I found this complete answer: http://johnstejskal.com/wp/unity3d-how-to-make-a-2d-gui-hud-interface-to-display-scorelives/ Thanks, and sorry for asking something so dumb :)
Follow this Question
Related Questions
Problems assigning sprite's images 1 Answer
Adjust overlay position for different resolutions 0 Answers
everything stretched on iPhone 5 2 Answers
Problem with 2D sprites 0 Answers