Godot Version
v4.4.1.stable.official [49a5bc7b6]
Question
I'm having issues getting a function to return whether or not a selected TileMapLayer cell is a valid place to spawn an enemy. The code below always prints (-1, -1), which as far as I'm aware means that it's not registering any cells at that spot. If someone could point me in the right direction that would be great!
func is_valid_spawn():
var invalid_spawns : Array = [
Vector2i(-1, -1),
Vector2(1, 0)
]
var local_coords = $PrototypeLevel/TileMapLayer.get_local_mouse_position()
var selected_cell = $PrototypeLevel/TileMapLayer.get_cell_atlas_coords(local_coords)
print(selected_cell)