In my AnimationCooker project I had a MonoBehaviour spawner in 0.51 that worked just fine. When I converted to 1.0, it stopped working. It uses World.DefaultGameObjectInjectionWorld.EntityManager.Instantiate() to instantiate a new entity based on an existing one. I’m using URP 14 and 2022.2.
It instantiates the entity just fine, and they can be seen in the Entity Hierarchy. Each spawned entity looks like it has all the right components and values as far as I can tell. The problem is that the entities aren’t rendered. I don’t think it’s a problem with the vertex animation because the same problem happens if I instruct the spawner to spawn a bunch of primitive cube entities.
Whenever I spawn the entities using a System with ecb.Instantiate(), everything works fine. So it has something to do with EntityManager and the MonoBehaviour. I don’t mind spawning from a System in this case, but in other parts of my game it makes sense to be able to spawn in an entity once in a while from a MonoBehaviour script when a button is pressed by the player or something. So I’d like to understand this issue which broke after upgrading to 1.0. If there is a problem with rendering entities created via EntityManager.Instantiate(Entity), I did not see a mention of it in the documentation.
These little tiny dots are shadows (I think) of the entities that were supposed to be spawned (the horse, spider, and cube). These shadows are much smaller than they are supposed to be, and of course the entities themselves are not being rendered. The horse and spider are the original entities that are being cloned. One thing I did notice is that the shadows only display for the entities that have vertex animation - the cube is just a standard cube and its shadows are not rendered.
So any ideas what is going on? If anyone wants to see the full source code it is here: Luke Clemens / AnimationCooker · GitLab (and the specific spawner code in question is here Files · master · Luke Clemens / AnimationCooker · GitLab ). Thanks for your help.