It looks like I’m still getting the same problems I had prior to 0.2.0.
Two problems:
1.
If I have an Entity that only has a LocalToWorld component, and add and set its Parent like so:
CommandBuffer.AddComponent(index, entity, new Parent {Value = newParent});
CommandBuffer.AddComponent<LocalToParent>(index, entity);
The entity now has a parent, but its LocalToWorld component is reset to 0,0,0. My assumption would be that the entity would retain its current LocalToWorld, but LTW and LTP are now zeroed out so the Entity teleports to origin upon assigning a Parent.
If I modify the Parent of an Entity its current Parent is automatically copied to PreviousParent as expected.
However I get the following error every single time:
I can get around it by increasing the size of the hashmap for UniqueParents in Unitys code, but obviously that keeps getting overwritten and I don’t want to fork it to fix this.
Is it because I’m doing it wrong? How am I supposed to do this?