Any difference in these "hit detected" methods?

I was looking through the API and found that it seems I can detect the hit in a couple of ways. The first is what Ben showed:

    FHitResult LineTraceHit = GetFirstPhysicsBodyInReach();
    AActor* ActorHit = LineTraceHit.GetActor();
    
    // Check that there was a hit, and grab the object if so
    if (ActorHit) {

Here is what I originally had, based on what I read in the API docs here:

    FHitResult LineTraceHit = GetFirstPhysicsBodyInReach();
    
    // Check that there was a hit, and grab the object if so
    if (LineTraceHit.IsValidBlockingHit()) {

Is there any appreciable difference? Could I use either?

Privacy & Terms