I'm currently learning about Unreal Engine 4 by making an FPS game.
How can I render the player character's hands and gun on top of everything?
Currently when I walk up to a wall, the hands and gun can clip into the wall like this:
I want it to look like this, where even when the player is facing into a wall, the hands and gun stay on top:
How can I achieve this?
Update: Found this solution:
Render the meshes at the end of the depth-only prepass with depth testing disabled and tagging those pixels in the stencil buffer. Then enable stencil test in the base pass to not touch those pixels. At the end of the base pass you turn off stencil test and render your foreground meshes with depth testing enabled to get their properties in the gbuffer."