Get_floor_angle doesn't work

4.2.1

Hello, my issue is very simple.
get_floor_angle straight up does not work
when i am on flat ground, it outputs 0.
when i am in the air or on a slope, it outputs 1,57079637050629.
I am using a regular rectangular collision box and a standard CharacterBody2D
Does anyone know why this is happening?

Godot uses radians and the positive x direction is 0. So a flat floor is 0 radians and down is Pi / 2 radians. (Approx 1.57)

What values do you want to see? You can convert with the rad_to_deg function.

Alright, im sorry, that was the issue. It stil does not detect sloped ground though.

I am able to detect a slope with the get_floor_angle function. The docs say this

Returns the floor’s collision angle at the last collision point according to up_direction, which is Vector2.UP by default. This value is always positive and only valid after calling move_and_slide() and when is_on_floor() returns true.

Are you calling move_and_slide?