I am working on a farming game, but I dont want to add crops to the same position or overwrite it. How can i prevent the overwrite part?
if event.is_action_pressed("Plant") and self.get_cellv(tile_pos_infront_of_player) == CONSTANTS.SCRATCH_DIRT_ID:
var crop_path = "res://Crops/Potato.tscn"
var crop = load(crop_path).instance()
crop.global_position = tile_pos_infront_of_player * 16
If you need more information for code let me know