Closed Gerrudo closed 1 month ago
Found solution here: https://stackoverflow.com/a/61199280
Unity is applying a 1 tile offset on the x and y axis when we're checking our terrain tile map.
I'm unsure if this is due to the size of tile, sorting layer or just a bug introduced by casting our mouse position to a Vector2. But
bool hasBuildingTile = defaultMap.HasTile(currentGridPosition - new Vector3Int(1, 1, 0));
seems to fix the issue for now.
Buildings are being placed 1 tile off the x axis on our terrain.
Found issue in .HasTile in PlacementAllowed()