# Raycast for brush

**URL:** <https://forums.unrealengine.com/t/raycast-for-brush/362389>\
**Category:** Blueprint\
**Tags:** Raycast, unreal-engine, brush, geometry-brush, Blueprint, question\
**Created:** [June 29, 2016, 9:57am UTC](https://forums.unrealengine.com/t/raycast-for-brush/362389 "2016-06-29T09:57:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StillAlive039](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StillAlive039](https://forums.unrealengine.com/u/StillAlive039)\
**Post date:** [June 29, 2016, 9:57am UTC](https://forums.unrealengine.com/t/raycast-for-brush/362389/1 "2016-06-29T09:57:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![StillAlive039](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StillAlive039](https://forums.unrealengine.com/u/StillAlive039)\
**Post date:** [June 29, 2016, 10:47am UTC](https://forums.unrealengine.com/t/raycast-for-brush/362389/2 "2016-06-29T10:47:08Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Ch3shireCat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ch3shireCat](https://forums.unrealengine.com/u/Ch3shireCat)\
**Post date:** [January 8, 2017, 12:57am UTC](https://forums.unrealengine.com/t/raycast-for-brush/362389/3 "2017-01-08T00:57:51Z")

</div>

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.
