While waiting for the next release of DOTS I’m working on animation for my ability/combat system with the hybrid apraoch.
Bassically I have a my simulation entity as a parent game object that is converted to entity. On the child I have the presentation game object that is not converted to an entity.
I managed to triger the animation on the child game object based on the simulation logic of the parent entity.
I converted it to a prefab and it works fine.
Now when I make a spwaner spawn that prefab, all the simulation is ok, but for the presentation I just get the model in a T pose and that’s it.
On the screenshot bellow you can see the result.
The far rigth soldier is purely a GameObject (no logic)
The midle front soldier is a parent entity (simulation) with a child entity (presentation) controled by player
The middle back soldier is a parent entity (simulation) with a child entity (presentation) controled by AI but set in hierachy
The far left soldier is a parent entity (simulation) with a child entity (presentation) controled by AI but spawned by the spawner
It seems the prefab does not care about the StopConvertToEntity.
Looking at the Entities window it seem that the prefab and spawned unit both have the gameobject converted has an entity :
Ugly solution that works proposed by discord member :
Store the presentation gameobject prefab on the parent entity in a class component and instantiate the presentation gameobject at runtime.
It works and I can still add the animator componentobject to the parent entity to control the simulation but I now also have to synchronize the position of the presentation game object with the presentation entity.
Can’t wait for 0.50 hopefully I’l be able to go full DOTS…