Double jump for non-Humanoid character

I am trying to make a non-Humanoid character (it is a human in a shpere) have multiple jumps. It should reset when it lands but this is very challenging to get right. Things I tried:

  1. Try to calculate where a touch occured based on the sphere position and the touched part position. Does not work.
  2. Try to weld a part on the bottom of the character and listen for touch there. This would work but my sphere rotates based on where the character is looking. This makes the bottom part rotate too. Then the double jump breaks completely.

Is there any way to weld to parts based on positions and not take into account the rotations? Or maybe there is a better way to make this ground detection.


I solved it by casting a ray under my feet every time a touch happens. If the ray hits the same part as it was touched then it means I am grounded.