CharacterBody2D getting stuck going over corners on slopes

Godot Version

Godot v 4.7

Question

I'm having an issue with my CharacterBody2D stopping/slowing down when hitting the corners on slopes, when moving up.

Capsule shaped collision. The “World” layer is a staticbody2D with CollisionPolygon2D shape.

Works fine when coming down the slopes, but not up them. It’s frustrating cause this wasn’t a problem a couple of weeks ago, and as far as I know I didn’t make any changes to this part. Any help appreciated to how I can get my character smoothly over the slope

Attaching code that handles the basic movement:

func apply_friction(input_axis, delta):
if input_axis == 0 and is_on_floor():
velocity.x = move_toward(velocity.x, 0, movement_data.friction * delta)



func handle_acceleration(input_axis, delta):
if not is_on_floor(): return
if charging: return
if s_atk: return
if input_axis != 0:
if state_machine.get_active_state()==aim:
velocity.x = move_toward(velocity.x, aim_speed * input_axis, movement_data.acceleration * delta)
else:
velocity.x = move_toward(velocity.x, movement_data.speed * input_axis, movement_data.acceleration * delta)
if state_machine.get_active_state()==idle:
state_machine.dispatch(&“start_walking”)



Are you using the rectangle collision shape or the capsule for your character body?

As I said in the OP, it’s a capsule shaped collision

Bumping this up as it’s still a problem

Are you calling “move_and_collide()” instead of “move_and_slide()”?

Using move_and_slide()