I am having trouble accomplishing a highlight effect on cells as my player walks around on the grid.
I was using an example I found but I believe it isn’t for isometric grid also it replaces the tiles and I just want to highlight them temporarily as my player moves around. The purposes would be for the player to interact with the tile highlighted. How could I accomplish this?
Note: also the tile that are currently getting selected are not in the correct position and do not work if the character faces different direction.
Examples:
// do late so that the player has a chance to move in update if necessary
private void LateUpdate()
{
// get current grid location
Vector3Int currentCell = gridLayout.WorldToCell(_player.transform.position);
Debug.Log(currentCell);
// add one in a direction (you'll have to change this to match your directional control)
currentCell.x -= 2;
currentCell.y -= 2;
// if the position has changed
if (currentCell != previous)
{
// set the new tile
highlightMap.SetTile(currentCell, highlightTile);
// erase previous
highlightMap.SetTile(previous, null);
// save the new position for next frame
previous = currentCell;
}