Hi! In this case you can use linetrace! All you need for that is that line of code
world->LineTraceSingleByProfile(OutHit, actorLocation, actorLocation + distance * actorForwardVector, ProfileName, collisionQueryParams);
or this
world->LineTraceSingleByChannel(OutHit, actorLocation, actorLocation + distance * actorForwardVector, TraceChannel, collisionQueryParams, collisionResponseParams);
actorLocation, distance, actorForwardVector - rather obvious. You can use collision profile or trace channel to make linetrace more optimized and fast. In query params you can add actors to ignore and smth like this.