The only thing that matters for CollisionWorld queries is that the appropriate Unity Physics baked representations of the colliders are present. Both custom authoring and classic Collider / Rigidbody components are baked to the same components (PhysicsCollider, PhysicsMass, PhysicsVelocity, ???) as long as they exist within a SubScene that gets baked. You should see the corresponding baked physics components for that object in the Entities Hierarchy view regardless of how the collider and rigidbody were authored.
Alright, I see that you’re right and I didn’t look closely enough. I see the Physics Collider, Physics Gravity Factor, Physics Mass, and Physics Velocity.
My issue was trying to raycast for my units and I don’t know how to set the Collision Layer for the unit to use in my CollisionFilter.
With the Custom Authoring it looks like you can simply set these layers. These layers are different from the normal layers in Unity, right?
They are related but decidedly distinct. The concept of “normal layers” does not really have a presence within a World outside the subsystem-specific representation of layers. “Normal layers” can bake to Unity Physics layermask values and the render layer for Entities Graphics RenderFilterSettings.
Additional information that may be pertinent:
The “normal layers” (the layer a GameObject is set to belong to) are used to generate the appropriate values in Unity Physics as well as Entities Graphics. When converting a Collider, the BelongsTo mask will be the object layer, and the project’s collision matrix (Edit/Project Settings/Physics/Layer Collision Matrix) is used to set the CollidesWith value based on the object layer.
The Collider component now has the includeLayers and excludeLayers fields, which logically should be used as another part of producing the CollidesWith value, but currently, this is not the case. This may be a bug, one that Unity has previously been made aware of.
For now, the best solution for cases requiring overrides for specific objects seems to be using the custom authoring. There’s a gap in functionality between what they want you to use (Collider, Rigidbody, etc.) and the authoring components that were created specifically for Unity Physics. Ideally, only the classic components would be needed, but they’re not there yet.