I'm using the GhostPresentationGameObjectAuthoring to spawn game object for my ghosts on all clients. If i delete multiple ghost entities on the server at the same time, I'm getting multiple exceptions from the GhostPresentationGameObjectSystem. First i get this error for each entity deleted: ObjectDisposedException: Attempted to access ComponentLookup<Unity.NetCode.Hybrid.GhostPresentationGameObjectState> which has been invalidated by a structural change.
Followed by two IndexOutOfRangeExceptions:
IndexOutOfRangeException: Index 0 is out of range in container of '0' Length.
and
IndexOutOfRangeException: Index (0) is out of range TransformAccessArray.Length (0)
the last one is thrown each frame.
I have a minimal example project setup to reproduce this issue. I can attach the full stack trace as an additional message if need be (didn't include the full stack trace to not bloat the initial post too much).
I assume this is a bug or is there another 'intended way' of deleting ghosts with a ghost presentation game object that won't cause these exceptions?