tl;dr Entity with PhysicsVelocity+Translation+Rotation components is not picked up by BuildPhysicsWorld#
DynamicEntityGroup query.
This issue occurs in 0.2.5.preview.1 in the Server World (NetCode), but to my knowledge did not occur in earlier versions. I believe it also did occur outside NetCode.
I have a weird issue where the DynamicEntityGroup
in BuildPhysicsWorld
is empty because I have no PhysicsVelocity
components, even though I have GOs in the scene which have a Physics Body
authoring component with Motion Type dynamic
.
This then results in a failure in the CreateJoints method, because [CreateJoints] pair.BodyAIndex: -1, pair.BodyBIndex: -1
.
As usual, the issue occurs in my example car (are you sick of it already? :(), where I have four wheels which are connected to the main car body via joints, and they are in a parent-child relationship with the main body. Each wheel has a Physics Body
authoring component.
When I start paused play mode, after clicking step once, the BuildPhysicsWorld
system appears, but finds 0 dynamic bodies, since none of the wheels appear to have a PhysicsVelocity
(or Translation or Rotation) component, according to the BuildPhysicsWorld
system.
When I add a cube to the scene with a Physics Body
authoring component with Motion Type dynamic
it receives a PhysicsVelocity
component normally.
So, with the cube, in the debugger, I have this situation:
Only the Cube is picked up in the BPW system as dynamic, but none of the wheels.
In the console, I am printing some information about what happens in the BPW system:
So it picks up the one dynamic body (the Cube), and then tries to find bodies for the joints, which it fails, because the only bodies are the Cube and the plane, but none of the wheels.
However, in the debugger, when I select a wheel (entity 24), it lists that it has all the needed components to be picked up by the BPW system as a dynamic body:
I am utterly confused – why would entity 24 with PhysicsVelocity+Translation+Rotation components not be picked up by BuildPhysicsWorld?
I am happy to try and compile a case, but wanted to first ask if this is a known issue and if perhaps there is an obvious mistake I am making…? (Especially since the debugger clearly shows entity 24 with the necessary components)
Cheers and thanks for any help!