Download

Ignore Line Trace and Collision

Hello everyone, I’m so confused about this subject. I have 2 questions.

1)How to ignore actors or pawns or characters or objects?

In Unity3D, set a layer for object and in code as follows:



LayerMask ignore = ~(1 << 10 | 1 << 11); // Ignore tenth and eleventh layer.

if(Physics.Raycast(..., ignore))
{
...
}


It works on all objects which is have tenth or eleventh layer.

In Unreal, I think;



...
if (GetWorld()->LineTraceSingleByChannel(..., ECC_GameTraceChannel2, ...))
{
...
}


It work for only 1 channel. But I want to ignore 2 or more channel.

2)How to ignore collision?

Unity3D has layer based physic matrix. You can choose who will interact.
Unreal Engine has Object channels but I think, I have to set up it each object via Collision Presets.

Note: I started with C++ project.