# Spherecast Missing Hit?

**URL:** https://discussions.unity.com/t/spherecast-missing-hit/649413
**Category:** Physics
**Tags:** Scripting
**Created:** [December 18, 2016, 8:21pm UTC](https://discussions.unity.com/t/spherecast-missing-hit/649413 "2016-12-18T20:21:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![boxhallowed](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/boxhallowed/32/161276_2.png) [@boxhallowed](https://discussions.unity.com/u/boxhallowed)
#### Post date: [December 18, 2016, 8:21pm UTC](https://discussions.unity.com/t/spherecast-missing-hit/649413/1 "2016-12-18T20:21:59Z")

</div>

Howdy, am I using spherecast in the wrong way?

```auto
Physics.SphereCast (FloorColliderRef.center, FloorColliderRef.radius -0.05f , Vector3.down, out circleSweepFloor, FloorColliderRef.radius + 1, floorLayerMask.value)

```

I have a floor collider at the feet of the character, and I want to detect the floor below it which has a floor mask. If I use a standard raycast, it finds it with no problem.

Now, I know there is lots of solutions for this, but for my particular needs, spherecast would work best. I specifically need to know, if I am using spherecast in the right way. Right now, I am trying to use it to see if the spherecast collides with the floor layer and I am using it as a boolean. IE:

```auto
if(Physics.SphereCast (FloorColliderRef.center, FloorColliderRef.radius -0.05f , Vector3.down, out circleSweepFloor, FloorColliderRef.radius + 1, floorLayerMask.value)) { yada...

```

Thanks for the help!

---

<div class="post-metadata">

### Author: ![tonemcbride](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/tonemcbride/32/373210_2.png) [@tonemcbride](https://discussions.unity.com/u/tonemcbride)
#### Post date: [December 19, 2016, 11:22am UTC](https://discussions.unity.com/t/spherecast-missing-hit/649413/2 "2016-12-19T11:22:21Z")

</div>

I can’t tell from your code but it looks like you are starting the spherecast from within the floor - if you’re using spherecasts it would make more sense to start it from a higher position so it’s starting from a point where it isn’t colliding with anything.
