Unity-Technologies / 2d-extras

Fun 2D Stuff that we'd like to share!
Other
1.56k stars 344 forks source link

Lagging/Slow on game mode #246

Open jonid89 opened 4 years ago

jonid89 commented 4 years ago

Hello, i'm new to coding and Unity, this is my first project and it's lagging when i try it on game mode. The more the tiles I add on the grid, the slower it gets. I believe it's due to the Tiles Rule. Anyone has any idea why this could be? I uploaded all the project files here: https://www.dropbox.com/sh/ynfaio61k8p1ppe/AADQXJOrLzVx7nrK50qBvatoa?dl=0 Thank you.

ChuanXin-Unity commented 4 years ago

Hi, for your RuleGroundJungle Rule Tile, I would recommend leaving the GameObject field for each Rule empty.

When the GameObject field is set, it will create an instance of that GameObject in your scene. Right now, it is set to the Tile Palette, which means that each Rule Tile in your scene will create an instance of the Tile Palette in the scene. Not only that, as each Tile Palette has the same Rule Tile in it, each new instance will generate more copies of the Tile Palette in the scene, causing a massive slowdown.

jonid89 commented 4 years ago

Hello, that worked marvels. Thank you very much.