#I m getting a index outside of bounds of
1 messages · Page 1 of 1 (latest)
fuuuckkk
with tilemaps
i mean code wise
public void refresh()
{
tilemap.ClearAllTiles();
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
if (map[x, y] == 1)
{
tilemap.SetTile(new Vector3Int(x, y, 0), worldTiles[0]);
}
}
}
Debug.Log("Refreshed!");
}
okay thats fine too
how are you drawing the walls
or how does it know its a wall
outer edge
line 92
if (x == 0 | | x == width - 1 | | y == height - 1 | | y == 0)
{
map[x, y] = 1;
}
okay that looks fine too
I think I actually tried removing the equals sign originally and put it back when I encountered the chunk bug
when is refresh called
whenever a chunk is made/loaded
also why is this method a coroutine?
why not just generate the map
If I don't do that when I try and generate worlds on the scale that I want to generate it immediately crashes Unity
then display it
thats not how my game works
but thats a different topic
its not like mc
its like starbound
or terraria
the map is pre made on first load
then just make it into a task
and run it in the background
arbitrary yields are kinda pointless
this is just what i was told to do
whoever told you this is memeing but okay hmm
I don't want this script running during gameplay
i want it to run on world gen
then be dead forever never comming back
i see
change it to waitfornextframe
It's a very very sequential script it has to run in a very particular order
as of now with my Knowledge of coding this is what I'm comfortable with\
with vs?
after the array is filled
and can you check the right wall
coordinates
in your map variable
either that or you can download teamviewer and i can take a look
or discord
can do screen share
either or
does this server have vcs?
don't think so