Godot Version
4.2.1
Question
Hi all, im stuck with this for over a week and i cant get my head around on how this works. The setup:
I have a Area2D that if collides with the tilemap (name = tilemapObjects) it pass the reference of the tilemap to the Player from the player in the physics_process() im passing the global_possition
(var tileData = _tilemap.get_tile_data_at(global_position))
of the player to the tilemap function
func get_tile_data_at(_position: Vector2) -> TileData:var local_position: Vector2i = local_to_map(to_local(_position))return get_cell_tile_data(0, local_position)
after this call im calling in the player
if(tileData != null): print("DO SOMETHING)
The problem: When i collide with the tilemap i get the reference and i pass the position of the player it to the tilemap but when i want to get the tileData is says that there is no custom data. If i place the tile to be above the ground and the player collides with the tile it works as intended how could i get the tile if its bellow me or on the side of the wall or above? My thought was if i have a collision with the tilemap i can get the custom data at the collision.
Tilemap Setup picture: