Search Unity

Question How to find the edge tiles of a tile grid

Discussion in 'World Building' started by keytotototo, Nov 1, 2022.

  1. keytotototo

    keytotototo

    Joined:
    May 11, 2022
    Posts:
    1
    Hi. I'm aware that a thread with a similar name already exists, but it didn't help me, so I'm posting myself. I'm making a small turn based game where you use cards to gain powers. I'm new at programming, so figuring things out has taken a frustratingly long time :) I made a procedural isometric grid using unity's tilemap, so the code is the same as you'd use to make a standard rectangular grid (which is why I'm not posting it). Now I want ro randomize the tiles a bit. One of the things I wanted to do was make a stone wall on the edges of the grid and place a small amount of stone tiles inside the grid as well to make those tiles unwalkable. On a reddit post I made, someone suggested to use perlin noise that increased towards the edges and give the stone tiles a threshold to only place them on the grid if their threshold is >= to the noise value, but this is the first time I'm procedurally generating anything, so I'm lost, I don't know how to code that. Can someone please help me place stone tiles on the edges and inside the grid and make them unwalkable?