screen space camera hud (4.6 beta)

I am making a fps, I would like to give to the health bars, inventory and ammo count a 3d look.

So I chose screenspace - camera.

The problem is:

  • If the canvas plane close to camera then gui lags behind camera movement

  • If canvas plane far then gui gets hidden behind terrain and other objects.

Help please?

34247-unityproblem.png

What you can do is create a new camera and use it for the hud. Set it to depth only and make the depth the highest of all camera’s. Make sure the near clipping is lower than the plane clipping distance of the canvas or parts of the hud won’t show. Set the hud ui to a unique layer and set the culling mask of the camera to that layer. This all will prevent the hud from getting hidden by other objects.

Attach the camera to some view that you control so that you won’t have lag.

Try screen space - overlay. This will render everything last (ie on top of the world)