Godot Version
4.3.rc2
Question
My tiles won’t be drawn in the game I need the tile to be placed in front of the player and I do it all correctly but the tiles don’t show I used the Tileset.CELL_NEIGHBOR to put the tile in front but the tile won’t show
Here is my Script
extends Node2D
@onready var TILE_MAP = $Map
@onready var Layer = 1
func _input(event):
if Input.get_action_strength(“lmb”):
#var mouse_pos : Vector2 = get_global_mouse_position()
#var tile_player_pos : Vector2i =TILE_MAP.get_neighbor_cell(mouse_pos,TileSet.CELL_NEIGHBOR_RIGHT_SIDE)
var player_pos : Vector2 = Global.player_pos
print(player_pos)
print(TILE_MAP.get_neighbor_cell(player_pos,TileSet.CELL_NEIGHBOR_RIGHT_SIDE))
var tile = TILE_MAP.get_neighbor_cell(player_pos,TileSet.CELL_NEIGHBOR_RIGHT_SIDE)
var tile_set = tile
var source_id : int = 0
var atlas_coord : Vector2i = Vector2i(50,17)
TILE_MAP.set_cell(1,tile_set,source_id,atlas_coord