Quote: "I'm also using raycasting to decide how dark my object's shadows should be as it also returns data you can get a distance from. "
Good thinking.
I'm using a variable on the character to let it know it's on the ground. I send two raycasts down, one on each side of his feet, and if either is on the ground then I assign a third variable:
char[0].right_foot_on_the_ground = SpriteRayCastGroup( 1, GetSpriteXByOffset( char[0].sprite_number )+0.2, GetSpriteYByOffset( char[0].sprite_number ), GetSpriteXByOffset( char[0].sprite_number )+0.2, GetSpriteYByOffset( char[0].sprite_number ) + GetSpriteHeight(char[0].sprite_number)/2 )
char[0].left_foot_on_the_ground = SpriteRayCastGroup( 1, GetSpriteXByOffset( char[0].sprite_number )-0.2, GetSpriteYByOffset( char[0].sprite_number ), GetSpriteXByOffset( char[0].sprite_number )-0.2, GetSpriteYByOffset( char[0].sprite_number ) + GetSpriteHeight(char[0].sprite_number)/2 )
char[0].on_the_ground = char[0].right_foot_on_the_ground or char[0].left_foot_on_the_ground