First Person Wears a gasmask and see through it

Hello Unreal Engine community,

I’m currently working on a project in Unreal Engine 5 and I’m looking to implement a mechanic where the player’s first-person character can pick up a gas mask item and put it on, with the view transitioning to seeing through the gas mask’s lenses. I’ve been struggling to find a comprehensive tutorial on how to achieve this specific functionality.

Specifically, I need assistance with:

  1. Animating the player character’s hands to wear the gas mask on his face.
  2. Implementing the transition of the camera view to simulate looking through the gas mask lenses.
  3. Ensuring the gas mask stays attached to the character’s head and moves with the character’s animations.

If anyone has any resources, tutorials, or guidance on how to accomplish this within Unreal Engine 5, I would greatly appreciate it. Any help or pointers in the right direction would be invaluable to me.

Thank you in advance for your assistance!

i think a mask feeling is just a ui widget added to viewport, like two holes or sth.

as a first persion, why in the hell u need to attach a mask mesh to your character, a boolean is well enough.

I can’t help with #1, but I can tell you that #2 and #3 are all done through visual effects, not by actually putting a mask model on top of the camera/head.
In fact, most first person shooters don’t even put the camera where the eyes really are; it’s more likely to be somewhere around high-chest, low-chin area. Typically the body doesn’t even render, although you’re going to want to render it into the shadow buffer (your body does cast a shadow!) and if you want to be able to look down and ‘see legs’ you obviously need to do something for that.

Typically, you will develop a mesh or texture that overlays the screen as a full-screen overlay and install this when the mask is “on.” If you want the lenses to bend light differently, you’re going to need to build this as a post-processing effect that can sample from different parts of the framebuffer to implement distortion.

Thanks a lot for your reply, I will try that:)

I am still new to unreal so I don’t know how everything works but I wanted to see the edges of the masks, this is why:) thank you for your response

You can build a full-screen overlay picture that has gaps on the side to still see the edges.

It is possible to attach meshes to the camera itself, and thus render those meshes in front of the camera, but in general, I’ve found this to be much less robust. If you want to try this, open up the player pawn (character) blueprint, find the camera, add a child component of the camera that’s a Static Mesh Component, and mark it “hidden in game.” Move it out a little bit ahead of the camera. When you want to show something in front of the camera, configure this component to use the appropriate asset, and turn off “hidden in game.”

Thank you so much, I will do a screen overlay then. Is there a way to trigger it when a key is pressed for instance? I already set up a system where the user presses “E” to pick up the mask.

There’s a few ways to do it.

The first is to add some slot/widget to your HUD, where you can add (or show) a texture that you make, across the screen. Presumably you’d set some variable on the HUD widget that it binds to whether to show the overlay or not.

The second is to put a simple plane object in front of the camera object, with a texture mapped on it, probably using an unlit, transparent material. Show this plane object when you have picked up the mask.

The third is to build a post processing material that samples the overlay texture, as well as distorts the underlying framebuffer. You add this post processor when the player has picked up the mask, and remove it again when it’s off.

Here’s the documentation on post processing materials:

You can also search for the above words/concepts for more tutorials and documentation, depending on which way you want to go.