I’ve been playing around a bit with having multiple worlds where I load, set up and initialize entities in one world and then move them to a destination world once they’re ready. I’ve currently stumbled upon the issue where entities that point to each other get faulty entity references upon moving them.
So my question therefore is: If I’ve got entities with unknown and arbitrary components that contains references to each other, is there a recommended or perhaps already existing way to get these references updated properly when I move the entities with the EntityManager.MoveEntitiesFrom-function?
I’ve seen a bunch of internal code related to entity remapping and watched the Unite talk regarding it, but haven’t really understood how to use the functionality, or if it’s even intended for these kinds of applications. Does anyone have any guidance on the subject?
Thanks for the quick response and the clarification. I’ll investigate further, as I seem to be having some issues with this. Is this supposed to cover all component types? I seem to have issues with ISharedComponents that contain entity references specifically. Their references doesn’t seem to get updated when moved.
I just now tried making an ISharedComponentData and a regular IComponentData and set their values to point at the same entity, but after move only the IComponentData points correctly and the ISharedComponentData points at the same ID as before the move.
I can set up an example project and report it as a bug tomorrow if it’s intended to work.