Circle shape CollisionShape2D collisions against TileMap tiles

Godot Version

v4.5.1

Question

I’m brand new to using Godot and have very limited experience with making games in general. So I’ve just learned using TileMapLayer and CharacterBody2D nodes. In my TileMapLayer, I created a physics layer and applied it to the corresponding tiles. For my player, which is a CharacterBody2D, it has a CollisionShade2D with a circle shape.

I expected that when the player moves into the side of a tile, it will automatically move around the tile. However, that only works while the play is moving up. In the other directions, the player just gets stuck in most positions. It seems inconsistent between each direction you move.

This is all the code there is in the player script:
func _physics_process(delta: float) → void:
velocity.x = 0;
velocity.y = 0;

if (Input.is_key_pressed(KEY_W)):
	velocity.y -= SPEED;
if (Input.is_key_pressed(KEY_S)):
	velocity.y += SPEED;
if (Input.is_key_pressed(KEY_A)):
	velocity.x -= SPEED;
if (Input.is_key_pressed(KEY_D)):
	velocity.x += SPEED;
	
move_and_slide();

Furthermore, if the player is against a tile on the bottom, and you move left or right, the player will move down slightly when it moves past the tile.

Here’s a link to a video showing both of these issues:

Is you character body set to motion mode “Floating” or “Grounded”? In Grounded mode it expects floors, ceilings, and walls to behave differently, in Floating mode everything behaves like a wall, which is more accurate to your top-down perspective.

Oh my gosh yes that was it! Thank you! Like I said, I’m brand new so I had no idea that was a thing, and I was struggling to look up the issue.