I am on Unity version 2020.3.33f1, Entities 0.50.1-preview.2. Authoring is not working. Right now I have a monobehaviour called PlayerAuthoring.cs which adds several components with default values to whatever authoring gameobject it’s added to. When I change the default values and click “play” the values have not been changed on the newly spawned entities. Moreover, if I comment out the entire body of the “Convert” method then the components added in there will STILL be on the prefab when I click play. So if I have
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
dstManager.AddComponentData(entity, new Level { level = 1 });
dstManager.AddBuffer<Damage>(entity);
dstManager.AddComponentData(entity, new Health { CurrentHealth = 100, MaxHealth = 100 });
}
… and I comment out all 3 dstManager lines, my spawned prefabs will still have a Level, Damage, and Health component/buffer. If I remove the PlayerAuthoring component entirely then it seems to update. The next time I play the prefab no longer has the Level, Damage, or Health components. If I try to add the PlayerAuthoring component back, the prefab doesn’t get a Level, Damage, or Health component added on to it. It’s as if I didn’t add the authoring component on at all. This problem has persisted through a Unity restart, computer restart, and prefab reimport. It started happening earlier today for seemingly no reason.