# How Ignore mask in collision query params work?

**URL:** <https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985>\
**Category:** World Creation\
**Tags:** unreal-engine, Physics, Collision, question, CPP\
**Created:** [December 1, 2016, 6:59am UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985 "2016-12-01T06:59:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![roshan\_Ex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roshan\_Ex](https://forums.unrealengine.com/u/roshan_Ex)\
**Post date:** [December 1, 2016, 6:59am UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/1 "2016-12-01T06:59:34Z")

</div>

/\*\* Extra filtering done during object query. See declaration for filtering logic \*/  
FMaskFilter IgnoreMask;

```
/** This filter allows us to refine queries (channel, object) with an additional level of ignore by tagging entire classes of objects (e.g. "Red team", "Blue team")
    If(QueryIgnoreMask & ShapeFilter != 0) filter out */
typedef uint8 FMaskFilter;

```

Solution:  
Actor Team: team A and team B

**TestActor** (Team A) preform physics overlap detected with sight range, return actors only with team B

So how can I use **IgnoreMask** to filter actor with team B(like comment: e.g. “Red team”, “Blue team”)

---

<div class="post-metadata">

**Author:** ![roshan\_Ex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roshan\_Ex](https://forums.unrealengine.com/u/roshan_Ex)\
**Post date:** [December 3, 2016, 6:50am UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/2 "2016-12-03T06:50:37Z")

</div>

Is there a way to get TestActor with spe tag with a phy overlap function?  
Normally, get all Test Actors with array of Overlap result, and then loop for each TestActor and filter with tag. Like:

```
TArray Results;
    if (MultOverlap(Results, ....))
    {
         FilterResultsByTag(Results, "SpeTag");
    }
```

---

<div class="post-metadata">

**Author:** ![roshan\_Ex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roshan\_Ex](https://forums.unrealengine.com/u/roshan_Ex)\
**Post date:** [December 19, 2016, 3:47am UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/3 "2016-12-19T03:47:39Z")

</div>

Someone help!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1f0f0b8f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1f0f0b8f](https://forums.unrealengine.com/u/anonymous_user_1f0f0b8f)\
**Post date:** [May 23, 2018, 1:56pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/4 "2018-05-23T13:56:12Z")

</div>

Does anyone know how this works? as I’m trying to use it to disabled collisions between groups of actors, and there doesn’t seem to be any documentation for this feature.

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [May 23, 2018, 2:00pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/5 "2018-05-23T14:00:58Z")

</div>

I’ve not used it myself, but I think you’ll be looking for the SetMaskFilterOnBodyInstance method: [https://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPrimitiveComponent/SetMaskFilterOnBodyInstance/index.html](https://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPrimitiveComponent/SetMaskFilterOnBodyInstance/index.html)

There is some additional information here: [https://answers.unrealengine.com/questions/542930/is-there-a-way-to-disable-collision-but-not-overla.html](https://answers.unrealengine.com/questions/542930/is-there-a-way-to-disable-collision-but-not-overla.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1f0f0b8f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1f0f0b8f](https://forums.unrealengine.com/u/anonymous_user_1f0f0b8f)\
**Post date:** [May 23, 2018, 4:25pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/6 "2018-05-23T16:25:19Z")

</div>

Thanks

Yes I have tried setting the components of the first group of actors with  
SetMaskFilterOnBodyInstance(1) and  
SetMoveIgnoreMask(2)

and for the second group  
SetMaskFilterOnBodyInstance(2)  
SetMoveIgnoreMask(1)

I’m still getting collisions between the 2 groups, unless there’s something i’m missing.

---

<div class="post-metadata">

**Author:** ![Chris.Hunt2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris.Hunt2](https://forums.unrealengine.com/u/Chris.Hunt2)\
**Post date:** [November 8, 2022, 4:31pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/7 "2022-11-08T16:31:00Z")

</div>

for anyone reading this in the future, they are bit masks:  
SetMaskFilterOnBodyInstance(1 \<\< 1)  
SetMoveIgnoreMask(1 \<\< 2)

---

<div class="post-metadata">

**Author:** ![Skoutyboy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skoutyboy/32/876676_2.png) [@Skoutyboy](https://forums.unrealengine.com/u/Skoutyboy)\
**Post date:** [January 13, 2023, 9:24pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/8 "2023-01-13T21:24:12Z")

</div>

Here is how I use it:

FCollisionQueryParams QueryParams;  
QueryParams.IgnoreMask = 1 \<\< 3;

Now any sweep/trace that uses QueryParams will ignore any collision that has the MaskFilter = 1 \<\< 3.

So for any primitive component subclasses that I want sweeps to ignore I set:

SetMaskFilterOnBodyInstance(1 \<\< 3);

So If I have a Static Mesh Component, I would do:  
Mesh-\>SetMaskFilterOnBodyInstance(1 \<\< 3);

Now my sweeps/traces that use QueryParams will ignore Mesh.

---

<div class="post-metadata">

**Author:** ![cdonnellan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cdonnellan](https://forums.unrealengine.com/u/cdonnellan)\
**Post date:** [October 18, 2023, 4:14pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/9 "2023-10-18T16:14:13Z")

</div>

Can confirm that this does work - HOWEVER - you may need to call UpdatePhysicsFilterData on the Body Instance after setting the mask. That was the case for me, at least.

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [January 24, 2024, 8:03pm UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/10 "2024-01-24T20:03:22Z")

</div>

Does this works with USkeletalMeshComponent instances?

I’m able to use it on a UCapsuleComponent, but not on a skeletal mesh. I’m on UE5.3.2.

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [January 25, 2024, 10:56am UTC](https://forums.unrealengine.com/t/how-ignore-mask-in-collision-query-params-work/377985/11 "2024-01-25T10:56:53Z")

</div>

> [@Kafumanto](#):
>
> Does this works with USkeletalMeshComponent instances?

Found the solution ([credits](https://forums.unrealengine.com/t/how-to-use-maskfilter-with-skeletalmesh/150230/2)). For skeletal meshes the required code is more complex:

```cpp
USkeletalMeshComponent * SkeletalMesh /*= ...*/;
FMaskFilter Mask /*= ...*/;

SkeletalMesh->SetMaskFilterOnBodyInstance(Mask);
if (UPhysicsAsset* PA = SkeletalMesh->GetPhysicsAsset())
{
	for (USkeletalBodySetup * SBS : PA->SkeletalBodySetups)
	{
		SBS->DefaultInstance.SetMaskFilter(Mask);
	}
}

```
