I get:
The system Unity.Physics.Systems.BuildPhysicsWorld reads Unity.Entities.Entity via Jobs:CreateRigidBodies but that type was not assigned to the Dependency property. To ensure correct behavior of other systems, the job or a dependency must be assigned to the Dependency property before returning from the OnUpdate method.
If I attempt to do some casual Physics Queries single-threaded from within a SystemBase OnUpdate() method.
Just in case I do:
protected override void OnStartRunning()
{
base.OnStartRunning();
this.RegisterPhysicsRuntimeSystemReadOnly();
}
And OnUpdate:
protected override void OnUpdate()
{
//var ecb = World.GetExistingSystem<BeginSimulationEntityCommandBufferSystem>().CreateCommandBuffer();
var world = World.GetExistingSystem<BuildPhysicsWorld>().PhysicsWorld.CollisionWorld;
var filter = new CollisionFilter()
{
BelongsTo = ~0u,
CollidesWith = ~0u,
GroupIndex = 0
};
var distanceInput = new PointDistanceInput()
{
Position = new float3(0, 0, 0),// agent.PathEnd,
MaxDistance = 0.25f,
Filter = filter
};
world.CalculateDistance(distanceInput, out DistanceHit hit);
}
…But no luck, throws an error each time. I was sure it was working before though. I spend substantial time on this stuff now so it’s all kind of a blur… help!