Problem with raycast detecting ground if too close

https://gyazo.com/4684d871434fcafbc8112b9e9a657d9c

I am attempting to make a ground slam ability using raycast to determine if the player is in the air but it does not function correctly and determines that a player is off the ground if punch and they are at the lowest part of their jump, when in reality they shouldn’t be able to ground slam at all because the height limit is higher than they can jump

image

It doesn’t look like the root part ever gets above 8 studs off the baseplate. I think it’s working as intended because nothing looks wrong with the code. Also the in the if statement you can just say

if Raycast then

because nil is falsy. Also because nil is falsy, you can say

return not not Raycast

(not saying you should its kinda funny)