I’m new in Unity DOTS, and want to create a 2d topdown view game. Is there a correct way to work with Rigidbody2d and Collider2d in DOTS?
Built-in authoring working with Rigidbody and Colliders, but not for 2d analogs. Am i need to work with them, but ignore z axis, or work with Custom physics authoring(Physics Shapes, Physics Body)? Is there any other correct ways to implement these logic?
As you already figured out you have to use the 3D variants of Collider and RigidBody. In ECS Physics there is no 2D mode and it will likely never get implemented. So yes, you have to work with Z = 0. So your entities are at that Z position, you raycasts using zero Z and so on. But the colliders do still need some volume around Z = 0 so collisions, raycasts, etc. are working properly. You have also to ensure that all entities remain at Z = 0, for example when using the Physics Simulation. Also I had issues with Sphere Colliders, and figured out that correctly aligned Cylinders are working better. If you are working mit Physics Shapes of Sprites I can recommended using ProBuilder to generate volumes for them, because it allows extrusion of the flat shapes and thereafter they can be used as either MeshCollider or ConvexCollider.