basically, how does Godot know what a floor is ?? The code works fine, but i'm confused as I have not defined a node called floor, nothing is in a group called floor etc Does it just treat any staticbody as a floor? Had a quick google but couldn't see an explanation, thanks 🙂

Well,

bool is_on_floor ( ) const

Returns true if the body collided with the floor on the last call of move_and_slide. Otherwise, returns false. The up_direction and floor_max_angle are used to determine whether a surface is "floor" or not.

from:

https://docs.godotengine.org/en/latest/classes/class_characterbody3d.html?highlight=is_on_floor#class-characterbody3d-method-is-on-floor

The documentation is actually worth reading ;-)

    Those docs are for the new CharacterBody3D class in Godot 4. It has up_direction and floor_max_angle properties.
    In Godot 3, there's the KinematicBody and KinematicBody2D classes. They require you to pass up_direction and floor_max_angle to the move_and_slide function manually.
    https://docs.godotengine.org/en/stable/classes/class_kinematicbody.html#class-kinematicbody-method-move-and-slide