- Home /
How to make a 3d object act like GUI?
I'm making a first person game where the player is able to see their hands. Because of different screen resolutions, the hands might not show up on all computers the right way if I just made them stay right in front of the camera, so I was thinking about trying to make the hands act like they're GUI, like in many other first person games, such as Call of Duty. So could I make the hands do that instead of making them a physical game object?
What, as gui, NO one uses that method. I also do not know what you mean by the hands might not show up, it changes a little but not that much.
What you can do is make the camera's FOV higher/lower for different resolutions, or just alter settings in the camera, then if it works make those values assigned in Awake();
In every first-person game I've played where the player can see their character's hands, it acted like GUI. Also, making the hands not like that will also take up a lot of room for the player if they're holding something. I do agree with what you said about the hands not showing up, as that only happened once for me. Anyways, if you ever play a first-person shooter and walk up to some object very closely, you'll notice that the size of the person's hands don't change and they are still in the same position (which is unrealistic, but makes game play better). So when I said GUI, I meant that I wanted the object to stay in the same position in front of the camera and always be visible.
Answer by robertbu · Mar 08, 2014 at 10:26 PM
First, the way Unity works is that the amount of world units seen vertically remains fixed across all resolutions. The amount seen horizontally changes as the aspect ratio of the screen changes. The result is that your hands should remain the same across all resolutions. In fact that is just the opposite of what would happen if you used GUI to display the hands. In GUI, things are specified in pixels. So if the density of the resolution goes up, things get smaller...the opposite of what you want for the display of hands.
Referring to the question you ask in your title, many third-party GUI systems use world objects. They use a second, Orthographic camera for the display of objects. This allows for fixed sizes and allows all the object to appear in front of the scene displayed by the main camera.
Thanks, I didn't think of using an orthographic camera. I did think of using a second camera, but I couldn't figure out how to make the background transparent. If anyone else has this problem, set the clear flags to depth only.
Your answer
Follow this Question
Related Questions
Plane Object as GUI - Lighting Issue 1 Answer
Orthographic environment with Interface 1 Answer
GUI Follow RaycastHit 2 Answers
A 2D GUI in mid air, for oculus, tracking an object. 1 Answer
Changing 3d text through script 1 Answer