Godot Version
godot-4.2.1
Question
I am running into issues with getting custom data on a tileset. This is my code:
position = Vector2(startingPosition)
newPosition = position
var hovered_cell = tile_map.local_to_map(newPosition)
var type_name = tile_map.tile_set.get_custom_data_layer_by_name("tileType")
print(type_name)
var data = tile_map.get_cell_tile_data(0, hovered_cell)
if data.get_custom_data("tileType") == "stairs":
print("Stairs hovered")
Right now when I try to print data, nothing is printed, neither does the print inside the if statement. The only print that is working is print(type_name), which returns the layer of the custom data (0).
What I want to do is return the tile type on the custom data I created inside the TileSet. Here is an example of where I have the data added on the tiles.