Question
Guys, i am trying to detect if a characterBody2D is stepped on an specific tile in a Top-Down 2D game.I dont know how to check if the player is stepped on that tile. I want too to make the conveyor belt out of that. Help will be appreciated.
Script
For now i have that👇 but it doesnt work heh.
extends TileMap
signal ConveyorActivated
@onready var character_body_2d = $“…/CharacterBody2D”
@onready var tile_map = $“.”
var data = “Conveyor”
func _physics_process(delta):
var tileData :TileData = tile_map.get_cell_tile_data(0, Vector2i.ZERO)
var conveyorData = tileData.get_custom_data(data)
print(“TestData: {0}”.format([conveyorData]))