Is there a way for raycasts to detect geometry brushes because I created a lightswitch using brushes and I want raycast to detect it. Is there a way?
Solved it. Just converted the brush I was using as a static mesh. If you guys have other idea I would love to hear it,
Sorry for digging out a dinosaur, but maybe someone will find it useful - I’m using simple function to get floor and surprisingly it works for brushes too.
bool AMyCharacter::CheckFloor() {
FVector TraceStart = GetActorLocation();
FVector ab = CapsuleComponent->GetScaledCapsuleHalfHeight()*Zaxis*1.05;
FVector TraceEnd = TraceStart - ab;
FHitResult OutHit;
GetWorld()->LineTraceSingleByObjectType(OutHit, TraceStart, TraceEnd, FCollisionObjectQueryParams(ECC_TO_BITFIELD(ECC_WorldStatic) | ECC_TO_BITFIELD(ECC_WorldDynamic)), FCollisionQueryParams(TEXT("IKTrace"), false, this));
if (OutHit.bBlockingHit)return true;
return false;
}
I’m tracing for any object below a character, if LineTrace hits something it returns true value. As I said, it worked for brushes too.