Author Topic: Raycast ground detection goes wrong  (Read 980 times)


  • Beta Group
  • Full Member
  • *
  • Posts: 164
    • View Profile
    • multiplayer adult fighting
Raycast ground detection goes wrong
« on: August 19, 2018, 11:46:50 AM »

Hello there! I have a very basic setup with a capsule collider and raycasting from it to the -Y. But when the collider is standing on the ground - raycast didn't see a ground. It start to works when I lift up the collider a very little bit, but stop when it fall back to the ground. Is it suppose to work this way or am I doing something wrong? What is the correct way to check if I am on the ground? Should I start the raycast not from the collider origin but from some offset point or maybe setup some thresholds in the physics settings?
indie developer of multiplayer adult fighting


  • Sr. Member
  • ****
  • Posts: 376
    • View Profile
Re: Raycast ground detection goes wrong
« Reply #1 on: August 19, 2018, 01:06:02 PM »
Maybe raycast from a bit higher?
I'd guess the start of the raycast is either right on or a bit lower than the floor collider's shell. Note that if the raycast is cast from inside a collider it will not hit