Can't make collisions work

Godot Version

4.3

Question

Hi, I’m new here and it’s my first time making games in general. So I wanted to start fresh learning Godot.

I learned to make the character move by tiles but I can’t make the collisions work. Here’s the code for Character and the tiles settings.

I would completely appreciate if you could give me help and advice on how to bring this problem to a solution and address it in the best possible way (both the movement by tiles, collisions and project management in general). I am completely open to suggestions and advice.

Seems like the collisions are working. You should check the tile the player is moving toward before tween-ing them to the position, check then move. You can use TileMap’s local_to_map and get_cell_tile_data for information on the next tile.

Usually CharacterBody2Ds are moved with their velocity property and the move_and_slide function, but you are subverting that by editing the position directly; It’s not necessarily an issue, but if you aren’t using the physical properties of the CharacterBody2D then it would be better to make your character’s root a Node2D or Area2D.