LineTrace without if statement working properly?

When doing the challenge I wrote my line trace like this:

	FHitResult ThingShot;
	GetWorld()->LineTraceSingleByChannel(ThingShot, Location, End, ECC_GameTraceChannel1);
	
	DrawDebugPoint(GetWorld(), ThingShot.Location, 20, FColor::Red, true);

The answer in the video is slightly different then this as it uses an if statement to only use the drawdebug when you get a hit, but when testing in unreal my version seems to be functionally the same. Red square appears when I shoot a wall, but doesn’t when I stand to far away from the wall.

So my question is can I leave it like this? Or is that likely going to make problems later down the line?

Nvm immidate next video uses the if statement lol

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

Privacy & Terms