Tracing hitting myself

Hi there! I encountered a problem while drawing the points, they seem to collide with the ShooterCharacter and with the Gun, I solved it only by adding distance to the spring arm of the camera and putting the character away (even more) from the center. I just wanted to know if I did something wrong on previews setups or if it would be normal to “hit myself”.
Checking the code I see that the starting point of the trace is the PlayersViewPoint so it would make sense, but I wanted to be sure. Also: Is there a way for the raytrace to ignore my character and the gun?

Just add this to your bool (the answer was on a different topic)

FCollisionQueryParams Params(NAME_None, true, OwnerPawn);
bool bSuccess = GetWorld()->LineTraceSingleByChannel(Hit, Location, End, 
ECollisionChannel::ECC_GameTraceChannel1, Params);

Privacy & Terms