I don’t know if this even exists or not, but I’m trying something like this (tp is a tilemap):
Vector3Int currentCell = tp.WorldToCell(transform.position);
if(currentcell.tile = dirt)
{
Lorem.ipsum;
}
I don’t know if this even exists or not, but I’m trying something like this (tp is a tilemap):
Vector3Int currentCell = tp.WorldToCell(transform.position);
if(currentcell.tile = dirt)
{
Lorem.ipsum;
}
Hi @aybarsmete1
“I don’t know if this even exists or not, but I’m trying something like this (tp is a tilemap):”
You first have to get the coordinate in tilemap “space” like you are doing.
Then you will have to get the tile, worldToCell only gives you a coordinate, Vector3Int doesn’t have any property like .tile.
To get tile, you have to use GetTile of tilemap - see the docs:
It gives you Tilebase describing a tile at that coordinate (if tile exists).
Edit: IIRC you at least can get the name of the tile from Tilebase, so you can use that to identify your tile type.
BTW …you are doing assignment in your if statement, where you should be doing comparison.
Thanks -btw I figured the procedural generation out, it now generates randomly-