2D Toolkit Forum

2D Toolkit => Support => Topic started by: HeuGamer on September 02, 2013, 04:02:04 pm

Title: TextMesh Overlapping Wall.
Post by: HeuGamer on September 02, 2013, 04:02:04 pm
Hey there, thanks for clicking on this thread!

So here's my problem. I'm trying to use the Textmesh on the FPS Controller, so the text mesh will be moving with the camera acting as a UI.
But here's the problem. Since the text is a mesh and it will overlap walls and such if you get to close and will not be visible anymore.

http://imageshack.us/photo/my-images/692/3543.png/

As you can see in the picture the textmesh is going through the wall whenever I look at it. Is there a possible way to make is so the text mesh will
always show?

The textmesh is a child of the main camera and the position is (0,1,2) from it.

Thank you in advance!
Title: Re: TextMesh Overlapping Wall.
Post by: unikronsoftware on September 02, 2013, 04:59:18 pm
Yup.

Create a second (ortho) camera, set it up so it clears depth, and display your HUD just on that camera. That way you can do whatever you like on the second camera and also won't be moving it around the world with the 3D camera (can cause jittering of UI elements).

Check out sample #6 - "button and 3d sprites", there is a 3D camera, and a secondary "UI" camera in front of it.
Title: Re: TextMesh Overlapping Wall.
Post by: HeuGamer on September 02, 2013, 05:15:47 pm
Do'h! It was that easy!?
Got everything setup in less than a minute!

Thanks you very much for the quick and informative reply!!