LineTraceSingle Does Not Work!

anonymous_user_294d04d5
Tue, 12 Dec 2017 04:21:45 +0000
Community & Industry Discussion

I used this tut: Unreal Engine C++ Tutorial - Making a gun! - YouTube But he has a older version of the engine.
Basicly in the part of the code:

	if (**GetWorld()->**LineTraceSingle****(HitResult, StartTrace, EndTrace, ECC_Visibility, *TracePrams)) {
		DrawDebugLine(GetWorld(), StartTrace, EndTrace, FColor::Green, false, 5.f);

		ATarget* TestTarget = Cast<ATarget>(HitResult->Actor.Get());

		if (TestTarget != NULL && !TestTarget->IsPendingKill()) {

			TestTarget->DamageTarget(50.f);
		}
	}

However the compiler in vs 2017 says: “LineTraceSingle” is not part of UWorld

Any feedback on a fix is appreciated!

Thanks in advance,

2 posts - 1 participant