#Can't assign component with Unity.Physics.PhysicsWorld using EntityCommandBuffer in jobs

1 messages · Page 1 of 1 (latest)

native topaz
#

I'm currently trying to create multiple Unity.Physics.PhysicsWorlds, and tying them to Entities as components. However, I've come across this interesting situation. When I try to assign a physics world using an EntityCommandBuffer in the main thread everything works completely fine. However, if I try to do exactly the same, except assigning it in a job. I get an ObjectDisposedException when I try to raycast against the world. I'm a bit stumped as to what's really going on. I'm not modifying the world in the job, and in the job itself the world is valid. However, it stops being valid after playback for some reason.

Anyone have any ideas?

Repro can be found here: https://paste.mod.gg/phhnumavmmnx/0
And here's the stack trace: https://paste.mod.gg/rohmiujlagkd/0