Hi there, I want to make a simple arcade game where you’re flying as a spaceship and have to avoid various obstacles. I’m not able to make any 3d models, so I decided this to be a 2d game (actually still 3d, but all textures would be flat). And here comes my problem, I have no idea what colliders and RigidBody to use, 3d one or 2d. For now I’ve made a few asteroids with random x and y position, but z set as 100. They’re moving only in z axis up to the player’s position - 0. But when I use a 2d Collider, it detects collisions no matter of object’s z position. Is it possible to not use 3D Colliders there and still achieve the same effect? I’ve never made anything in 3d in Unity yet. (If it’s nessessary, I’ll obviously learn how to make flat 3d objects, etc.)
If you want collisions to consider depth, you’ll either have to check thru 2D physics on your own, using the “minDepth” and “maxDepth” parameters in the Physics2D functions, or use 3D physics.
Just using 2D rigidbodies and colliders on their own will not consider depth.
1 Like