How to handle big amounts of animated gameobjects with sorting layer interaction?
Hi!
We are making a top-down Open-World RPG game and want to improve our looks with animated grass. It shall (periodically) move to look like a breeze is blowing through it and if the player walks through it, it moves accordingly.
By "sorting layer interaction" I mean that we set our project to sort objects according to their y position. So when the player is "behind" the grass (greater y - position), the grass is in front of him and if the player is "in front" of the grass it acts vice versa. I am saying this because if we would make one animation with many grass sprites in it, it would not be possible to make the (bigger) gameobject behave this way.
Here are some gifs to clearify my explanations:
grass in wind
grass walking through
behind/in front of grass
Image too big, you can have a look at it on my dropbox: https://www.dropbox.com/s/5esuv8mcdvanyc2/walking.gif?dl=0
Our main problem is (obviously) the performance. We want to fill a big part of our scene with this grass and we have no idea how we could make that happen.
Additions:
We have tried to use entities with unity dots, but we ran in many errors after the import of the preview packages and even in a clean project for testing, it did not improve the performance (at least the way we used it).
We thought about loading only some grass gameobjects as the player comes close to them (e.g. like chunk loading), but as there are so many ways to implement this we did not settle to try one out.
Thank you for your help!