HitResult - Can you Get Actor/Object Hit? -

Hi all,
Using Line Tracesinglebychannel, Ben uses HitResult out parameter. I notice that this parameter has a HitResult.Actor output.
But this is an AActor.

If you wanted to log this out to show what object is hit, how do you convert from AActor to ToString()?

After getting the HitResult the following will give you the name of the object hit:

UE_LOG(LogTemp, Warning, TEXT("Object hit by the linetrace: %s"), *HitResult.GetActor()->GetName());

Privacy & Terms