Hello! Do anyone know how to fix players tile detection when stepped on a specific tile?
Problem
When the player stepps on a specific tile then its detecting the layer thats in under the specific tile’s layer. If i change the layer ID then it will be detecting “null”
Script
Layer 0 is the ground layer, layer 1 is the specific tile’s layer.
(I use classic tilemap)
func _on_area_2d_body_entered(body: Node2D) -> void:
var tileCoords = conveyorTileMap.local_to_map(conveyorTileMap.to_local(position))
var tiledata = conveyorTileMap.get_cell_source_id(1, tileCoords)
print(tiledata)
Yea i used the global_position but it didint work either. The console is saying to the tileData -1(cannot detect tile source id) when its on the conveyor but if its on layer 0 it says 2(ground tileset source id).