Logging Collisions with our Ray Casting

FVector LineTraceEnd = PlayerViewPointLocation + PlayerViewPointRotation.Vector() * Reach;
private:
float Reach = 100.f;
GetWorld()->LineTraceSingleByObjectType(
Hit,
PlayerViewPointLocation,
LineTraceEnd,
FCollisionObjectQueryParams(ECollisionChannel::ECC_PhysicsBody),
LineTraceParams
);
FHitResult Hit;
FCollisionQueryParams
(
FName InTraceTag,
bool bInTraceComplex,
const AActor * InIgnoreActor
)
FCollisionQueryParams LineTraceParams(FName(TEXT("")), false, GetOwner());
AActor* ActorThatWasHit = Hit.GetActor();
if (ActorThatWasHit)
{
UE_LOG(LogTemp, Warning, TEXT("Line Trace has hit: %s"), * (ActorThatWasHit->GetName()))
}
Line Trace has hit : Cylinder_2

--

--

--

Full stack web developer with experience in Ruby on Rails, JavaScript, React and Redux and learning more!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating Awesome Cross-Platform Consumer Experiences With Flutter and SAS: Part 1 of 3

Top 10 Jenkins Plugins for DevOps in 2020

Codeforces problems #1–1471D

Hi, my name is Chip and I Tried Wordpress

Moving Forward with .NET Events, EventHandlers and CustomEventArgs

NetSuite and Toggl Integration — Client, Project, and Timesheet Synchronization

Divi Plugin Highlight: Divi Dashboard Welcome https://t.co/E59TYdU23o #WordPress #wp #wpthemes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Danny Padron

Danny Padron

Full stack web developer with experience in Ruby on Rails, JavaScript, React and Redux and learning more!

More from Medium

The Wheels Of Time

CS371p Spring 2022: Max Thomas

HCDE 451 Interactive Prototype

Covid-19 Community Typologies