When I do SetTile(pos, tile) it only changes in the scene view but not in game, ClearAllTiles() works though. EDIT: I fixed it by setting the z value of pos to 0 (pos.z = 0)
Amazing video I'm improving my Tilemap understanding a lot ! What if I want to keep the tile and its properties (in the tile script) but I just want to have different animations that I could spawn randomly or change through script ? Do i need another Animated Tile/Rule Tile in my scripted Tile to do it or is there another way ?
im using super tiled maybe thats why, but if I call for change of sprite aka door from closes to open sprite, its offset by 0.5 basically in between 4 tiles and I cant find the answer, even chatgpt cant help like wtf
ok, i did it! I just made a check if the x and y values combined were larger than the current number of iterations in the TryToSpread method if (Mathf.Abs(x) + Mathf.Abs(y) > iteration) continue;
So, in the last video, you changed the grid's cell size from its default value of 1 to fit the sprites. I'm guessing that doesn't change how the Vector3Int works to find a specific tile, then?
Yes, it shouldn't matter. It's basically just a database that keeps track of which cell is next to each other, 000 is next to 100 etc. , no matter how big they are in the world.
I'm trying to make cellular automata in unity's tilemap and I was thinking of reworking the fire from this into a tile updater, however I feel like there is probably a better way to get every tile position and update them, if so, could you perhaps make a video on that?
I think I would first loop through them and add every tile to a list. Use Tilemap.origin to get the lower left corner and Tilemap.origin + Tilemap.size for the top right corner. Then when you want to update the tiles, you can just use a foreach loop on the list where every tile is. Depending on the size of the tilemap, this might be quite performance heavy. Greetings
Content of this tutorial is Awsome. Story and complexity of series is great, but that names o variables in script are pain for newbies. Like Vector called mouseposition which you set as ...Input.mousePosition, same with data and others. To become Brackeys no.2 you need to be more newbie-friendly. But anyway this is 9 stars of 10, because unique content. Definetly like this channel.
Hello! I've done everything except for using the same fire prefab that you used and nothing is really working. I've been trying to solve this problem but I can't figure it out. I'm not even sure if the prefab is the problem.
@@ShackMan I don't have much of a full understanding of the tilemap system in Unity so apologies if I can't explain properly. All I'm trying to do in my game is replace a tile with another at runtime, similar to when you change the tile to an ash tile. To do that you need to know the position of the tile burning. In the code at 3:00 you define it, but I'm having trouble seeing where that position is actually connected to a tile in the editor.
@@TheDonuts97 at 8:54 is where we check for a mouse click and convert that from screen position, where the mouse is, to a grid position. Let me know if that is still unclear, it helps me to know how well people understand my videos.
Awesome video! Looking forward to the automatic object pool video you mentioned you're planning in the future.
Awesome tutorial...looking forard to more advanced unity tutorials from you
Good tutorial! Helps me solve some problem with unity tilemap. :)
This was exactly what I needed, Thanks!
When I do SetTile(pos, tile) it only changes in the scene view but not in game, ClearAllTiles() works though.
EDIT: I fixed it by setting the z value of pos to 0 (pos.z = 0)
Thank God, you saved my life here.
Amazing video I'm improving my Tilemap understanding a lot ! What if I want to keep the tile and its properties (in the tile script) but I just want to have different animations that I could spawn randomly or change through script ? Do i need another Animated Tile/Rule Tile in my scripted Tile to do it or is there another way ?
Helped alot 😊
im using super tiled maybe thats why, but if I call for change of sprite aka door from closes to open sprite, its offset by 0.5 basically in between 4 tiles and I cant find the answer, even chatgpt cant help like wtf
Thank you for this video. Really helped me
Snippet for a tilemap editor: map.SetTile(grid.WorldToCell(cam.ScreenToWorldPoint(Input.mousePosition)), tile);
how can i make it so it burns in a star shape?
ok, i did it! I just made a check if the x and y values combined were larger than the current number of iterations in the TryToSpread method
if (Mathf.Abs(x) + Mathf.Abs(y) > iteration) continue;
OMG GOOD JOB thank you
Clicking the link for "the part where the tiles are changed" just sends me to 0:00?
So, in the last video, you changed the grid's cell size from its default value of 1 to fit the sprites. I'm guessing that doesn't change how the Vector3Int works to find a specific tile, then?
Yes, it shouldn't matter. It's basically just a database that keeps track of which cell is next to each other, 000 is next to 100 etc. , no matter how big they are in the world.
I'm trying to make cellular automata in unity's tilemap and I was thinking of reworking the fire from this into a tile updater, however I feel like there is probably a better way to get every tile position and update them, if so, could you perhaps make a video on that?
I think I would first loop through them and add every tile to a list. Use Tilemap.origin to get the lower left corner and Tilemap.origin + Tilemap.size for the top right corner. Then when you want to update the tiles, you can just use a foreach loop on the list where every tile is. Depending on the size of the tilemap, this might be quite performance heavy. Greetings
My unity editor crashed!
Every time I run your script the editor crashes and I have to force it to restart.
There is a bug in your code
Content of this tutorial is Awsome. Story and complexity of series is great, but that names o variables in script are pain for newbies. Like Vector called mouseposition which you set as ...Input.mousePosition, same with data and others. To become Brackeys no.2 you need to be more newbie-friendly. But anyway this is 9 stars of 10, because unique content. Definetly like this channel.
Thanks for the feedback! At the current rate my channel is growing I will be Brackeys no.2 around the year 2350....
Hello! I've done everything except for using the same fire prefab that you used and nothing is really working. I've been trying to solve this problem but I can't figure it out. I'm not even sure if the prefab is the problem.
Sorry, late answer... You have to be more specific, is there an error message?
How do you get the current position of the tile you want to change?
I'm not sure what you mean, the first tile clicked? Can you describe more or give me a timestamp or line of code you are referring to? Greetings
@@ShackMan I don't have much of a full understanding of the tilemap system in Unity so apologies if I can't explain properly. All I'm trying to do in my game is replace a tile with another at runtime, similar to when you change the tile to an ash tile. To do that you need to know the position of the tile burning. In the code at 3:00 you define it, but I'm having trouble seeing where that position is actually connected to a tile in the editor.
@@TheDonuts97 at 8:54 is where we check for a mouse click and convert that from screen position, where the mouse is, to a grid position. Let me know if that is still unclear, it helps me to know how well people understand my videos.
Great video. Can you post this code on Github?
Thanks, good idea! I've uploaded it and added a link in the description. I'll try to upload the code for all future tutorials. Cheers
@@ShackMan Thanks. You are providing good intermediate tutorials. I appreciate it. :)
BSCRIBE!
BSCRIBE!