This would work but i forgot to mention i’m using a rigidbody as the player, so i can’t use the align_with_y function that characterbodies inherit, thank you for the suggestion.
I ended up digging thru the docs and found the Quaternion(vec3 arc_from, vec3 arc_to) constructor so i just did what the video i linked did.
var input_dir = Input.get_vector("left", "right", "forward", "backward")
var direction = (head.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
var slope_rotation
if center_cast.is_colliding():
slope_rotation = Quaternion(center_cast.get_collision_normal(), Vector3.UP).normalized()
else:
slope_rotation = Quaternion.IDENTITY
var adjusted_dir = direction * slope_rotation
linear_velocity += adjusted_dir * MOVE_SPEED