Controls debugging to help collision

Godot Version

4.5.1

Question

I have been searching around and I have been understanding less. My TileMapLayer has a collision layer, properly drawn, and is on the same Layer/Mask as my player. The player is instantiated into the scene.
This is the player code:

extends CharacterBody2D

const Speed = 100.0

func _physics_process(delta):
var direction := Input.get_vector(“Move_West”, “Move_East”, “Move_North”, “Move_South”)

if direction:
	velocity = direction * Speed
else:
	velocity = velocity.move_toward(Vector2.ZERO, Speed)

move_and_slide()

I was told on multiple sites that this was how I’m supposed to do it. I had spent enough time debugging the TileMapLayer, this is the only thing I can point at as the problem. Yet I do not know how else to do it, how to fix it. Can and may anyone help me with this?

What is the behavior you are seeing?

Currently, the player passes through the collision tiles as if they didn’t exist.

A few things to check:

1/ Does your CharacterBody2D have a CollisionShape2D (or CollisionPolygon2D) as a child node with a Shape resource (like RectangleShape2D) assigned to it? Setting the “Collision” layer/mask in the inspector doesn’t do anything by itself. The body needs an actual shape child to physically exist in the world.

2/ On the TileSet itself (open it from the inspector when you click your TileMapLayer’s tile_set property), do you have a Physics Layer added under “Physics Layers”? Then for each tile in the atlas, in the “Select” mode, did you actually draw a collision polygon under the “Physics” section? Painting a tile that has appearance set but no collision polygon will let things pass through

3/ Toggle on Debug → Visible Collision Shapes in the editor and run the game (you should probably actually do this first). This won’t fix it but it’ll help you debug it. You should see If you see cyan outlines around your tiles AND around your player

-_-
I checked the colisionShape2D, and it had “Disabled” checked on.
Damn these little things can be infuriating.