At first i didnt make it move. Now Iām moving it.
But good to know that there is even a more performant way.
At the Moment i play around having 5k units walking to a point. After I saw That 4k Units can get 400 FPS I was wondering why in my other projekt I get 60FPS with the same Prefab.
In this case I used
: MonoBehaviour, IConvertGameObjectToEntity
In my other case I used
entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(sheep, settings);
var instance = entityManager.Instantiate(entity);
and spawning 5k units over Time.
But it looks like when spawning many Units over Time the Performance is pretty bad
Either you spawn all units directly or you have bad performance.
I think there is a trick how to handle spawning units
After some playing around again and reverting all my Changes, it didnt work like that again.
I get 60FPS with 5k Units instead of 55k Untis.
The goal is having Many Units and then add a Rigedbody to smash them with a Hammer and let them fly anywhere.
Also they all search for a target to attack if they are not smashed.
Actually I use 3d model not Sprites. and I dont render myself. I just MeshRender the thing
But now i know what the biggest performance impact was.
Entities 0.3 is for me 100 Times slower then 0.4
Or its the Hybrid renderer 0.3 that is slower then 0.3.1
Now atleast I get 40k Units with 60fps just by updating dependencies
drawmeshinstancedindirect works with any mesh - the thread is just for reference, i.e. what i posted there is i.e. not optimized for quad and works with any mesh