# Hat + Hair Masking

**URL:** <https://forums.unrealengine.com/t/hat-hair-masking/2388070>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [March 13, 2025, 11:22am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070 "2025-03-13T11:22:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cl\_fabula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cl\_fabula](https://forums.unrealengine.com/u/cl_fabula)\
**Post date:** [March 13, 2025, 11:22am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/1 "2025-03-13T11:22:37Z")

</div>

Hello, i have an issue with my customizable character,

I have the ability to customize the player character by attaching meshes to his Head socket, the player can choose between multiple hats and haircuts.

The issue is if the player combine a hat + a haircut, depending on the hat, the haircut will pass trough the hat.

Example :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/f/78f241f0272fed2dbb4b94bdcd52385e5ba65781.jpeg)

My idea would be to create a cube associated with the HAT mesh, that cube would have no texture, but it would have a Specific “Hair-Mask” material assigned.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/c/7bc6cd5e49345bb1a2768105a5bcd718f3ef7b35.jpeg)

So each Hat would be exported to Unreal with 2 materials, the Hat material and the Hair-Mask material, and each hat would have this invisible cube that will define the masking zone.

So the question is the following ; Is it possible to somehow set a material to be masking another specific material ?

Mat\_Hair-Mask (from the hat mesh) would mask Mat\_Hair (from the Hair mesh)

Is that possible ?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 13, 2025, 11:33am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/2 "2025-03-13T11:33:09Z")

</div>

Look into the new mutable plugin in 5.5

---

<div class="post-metadata">

**Author:** ![cl\_fabula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cl\_fabula](https://forums.unrealengine.com/u/cl_fabula)\
**Post date:** [March 13, 2025, 11:34am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/3 "2025-03-13T11:34:37Z")

</div>

From what i’ve read, Mutable only works with skeletal Mesh but i use static mesh for my hats and hairs, so it wont work in my case unfortunately.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 13, 2025, 11:37am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/4 "2025-03-13T11:37:21Z")

</div>

You head and hair would most likely be skeletal meshes. The hat at that point can also be one.

Only other option would be vertex manipulation via world position offset and some sort of offset mask, or outright masking off the visibility. Though this may become problematic if you have many hats of many different shapes.

---

<div class="post-metadata">

**Author:** ![cl\_fabula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cl\_fabula](https://forums.unrealengine.com/u/cl_fabula)\
**Post date:** [March 13, 2025, 11:56am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/5 "2025-03-13T11:56:10Z")

</div>

My Head is apart from the skeletal Mesh, but all the assets for customization are static Mesh.

Can you elaborate on masking the visibility ?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 13, 2025, 11:59am UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/6 "2025-03-13T11:59:13Z")

</div>

In this case you would need to change the hair material from opaque to masked and then via a black and white texture tell the engine which parts of the mesh are masked off and which are still visible. Masked materials are cheaper than translucent ones.

The hair would need to probably have a second uv map that would govern the masking off parts of the hair.

Alternatively you could have a second hair mesh that would be the masked version.

---

<div class="post-metadata">

**Author:** ![cl\_fabula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cl\_fabula](https://forums.unrealengine.com/u/cl_fabula)\
**Post date:** [March 13, 2025, 12:15pm UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/7 "2025-03-13T12:15:37Z")

</div>

That would not work, because my hats have different sizes and angles, so the mask would need to be different for each type of hat.

In my case i need to find a way to make the “Hat mesh” be a mask to hide the hairs, that way each shape of hat would mask all the hairs.

I will experiment with stencils maybe there is a way, if i really cant figure a solution, i could try to make my hairs and hats skeletal meshes, but i will try to avoid it.

---

<div class="post-metadata">

**Author:** ![Splatterbaby](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/splatterbaby/32/574247_2.png) [@Splatterbaby](https://forums.unrealengine.com/u/Splatterbaby)\
**Post date:** [June 18, 2026, 3:15pm UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/8 "2026-06-18T15:15:26Z")

</div>

Did this ever get solved. masking hair on the top for a hat ? 5.7

---

<div class="post-metadata">

**Author:** ![cl\_fabula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cl\_fabula](https://forums.unrealengine.com/u/cl_fabula)\
**Post date:** [June 25, 2026, 8:49pm UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/9 "2026-06-25T20:49:32Z")

</div>

Unfortunately i never solved it, instead i allowed a single item on the head, so you can either have hairs or a hat.  
I still think this sould be possible somehow, but i dont really know how.

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [June 26, 2026, 3:28pm UTC](https://forums.unrealengine.com/t/hat-hair-masking/2388070/10 "2026-06-26T15:28:51Z")

</div>

Lots of games solve this by making a special hairstyle that fits under all hats, and swapping the normal hair to that when a hat is equipped. It’s a bit odd when a char goes from having long flowing hair to a random short style, but at least it avoids clipping. If you’re using a datatable or data asset to store hairstyles tho, you could link alternate hat-hairs there, and either make an alt mesh for every style or just make generic short/medium/long variants the styles share under hats and link them.
