is_on_floor() always returning false

Godot Version

4.5.1

Question

Hello, I’m new to Godot and I trying to make a simple 2.5D character controller and I’m currently working on adding gravity but some reason my player is never considered on the flow by the is_on_floor() function. I know I’m probably missing something so any help would be grateful. I’ve already looked at previous times this has been asked but the issue is still occurring for me.



I think you can just remove the if not is_on_floor() check so the player is always experiencing gravity (to simulate gravity always holding the player down)

that just makes the player falls through the floor

That would mean your player is not colliding with the floor at all. How is your scene tree set up?

Sorry for the late replay, heres what my tree look like

If you enable “Visible Collision Shapes” in the debug settings, are they at their correct positions?
And have you checked if setting the Fall_Speed value significantly lower has any effect on this?

  1. How are the collision layer and mask being set on the CharacterBody3D and the StaticBody3D?
  2. How’s the CollisionShape3D under the StaticBody3D node?
  3. What do the CharacterBody3D’s properties look like? Show me all of them.