CharacterBody3D and is_on_floor() - never reporting true

Godot Version

v4.3.dev4.official [df78c0636]

Question

Hello fellows,

I am working on a project in 3D using a CharacterBody3D, with a BoxShape3D as the CollisionShape3D, and a CSGBox3D as the floor. I have also tested this with a StaticBody3D to ensure it is not an issue with CSGBox3D, and the issue persists. This is being tested with a new CharacterBody3D with no changes to the node except for position.

My _physics_process is as follows. I have omitted my variable declarations, for the sake of troubleshooting please consider them as correct.

func _physics_process(delta: float) -> void:
	movement_vector.x = (Input.get_action_strength("playable_right") - Input.get_action_strength("playable_left")) * walk_speed
	
	if is_on_floor():
		if Input.is_action_just_pressed("playable_jump"):
			movement_vector.y = jump_velocity
	else:
		movement_vector.y -= _gravity
	
    print(is_on_floor())
	velocity = movement_vector
	move_and_slide()

Is there something fundamental I am missing with is_on_floor()? Is this a bug in v4.3.dev4?

Your assistance is appreciated.

Regards,

Hello fellows,

I have resolved the issue, and it is nothing to do with is_on_floor(). You see, I am porting a project from 2D to 3D, and it seems I am not used to the “Y-Up” method in 3D.

Thus, it was an error in my assumptions - and not the fault of Godot.

Regards,