How to prevent weapons from penetrating the wall?

In Unity you can simply render the gun on a different render pass and it will be on top of everything but HUD. In UE4 I also didn’t find a solution for this yet.