I remember there was a certain undocumented process to setting mask filters on various mesh types and primitives. I was wondering if anyone could confirm how this should be done. It’s been a while and I’ve forgotten.
My intent is to allow two pawns to move through each other and for traces to ignore them dependent on the mask set.
I’ve been using 1 as a bitmask for all actors involved as a test.
I’ve attempted this on a skeletal mesh so far but collision still occurs:
for (auto* PrimitiveComponent : PrimitiveComponents)
{
if (!IsValid(PrimitiveComponent))
{
continue;
}
if (auto* SkeletalMeshComponent = Cast<USkeletalMeshComponent>(PrimitiveComponent))
{
for (auto* BodyInstance : SkeletalMeshComponent->Bodies)
{
if (!BodyInstance)
{
continue;
}
BodyInstance->SetMaskFilter(1);
}
}
else
{
PrimitiveComponent->SetMaskFilterOnBodyInstance(1);
}
PrimitiveComponent->SetMoveIgnoreMask(1);
}