183. Line Tracing By Channel (Issue with debug line)

At the end of the video, the debug line is end when it hit the wall. However, I believe I followed his steps, but my debug line seem stop in air, like hit on something or what ?

Here’s my code
FVector Location;

FRotator Rotation;

OwnerController->GetPlayerViewPoint(Location,Rotation);

FVector End =  Location + Rotation.Vector() * MaxRange;


FHitResult Hit;

bool bSuccess = GetWorld()->LineTraceSingleByChannel(Hit, Location, End, ECollisionChannel::ECC_GameTraceChannel1);

if (bSuccess)

{

    DrawDebugPoint(GetWorld(),Hit.Location,20,FColor::Blue,true);

}

Could you eject and take screenshots of alternate angles?

Here’s the screenshots of alternate angles, thanks for responding.



Nevermind, I figure out the issue, it’s my BP_ShooterCharacter springarm issue.
This issue occur because early I want a nice looking camera angle. Therefore I adjust my springarm’s camera component, change the socket offset, the y-axis to 10. Also my target arm length is 180, so the distance between the camera and the character is too close, which cause the bullet hit on character’s shoulder.

I see. You can put your camera back as that issue will be solved in Ignoring Actors.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.