Unity Physics.SphereCast and Physics.SphereCastAll – A wider Raycast

Need a ‘wider’ Raycast? Try SphereCast 🙂

I just discovered the Physics.SphereCast and Physics.SphereCastAll. With those you can have the same results that you had with Physics.Raycast and Physics.RaycastAll but now you can set a radius for it! Isn’t that great?

*Just a quick, but important note: when using Physics.SphereCast you can’t detect collisions against Trigger Colliders.

You can find the docs of Physics.SphereCast here and Physics.SphereCastAll here.

 

🙂