Is it OK to use 2D colliders with 3D models?

I’m planning on making a platformer with 3D models, but 2D orientation.
Is it OK for me to use 2D colliders while using 3D models and perspective view?
Will it work correctly or am I going to face some problems?

As long as everything is done with 2D colliders you will have no problem. I have done the same thing on one of my games.

This question should have far more information for a complete answer.

The short short answer is “yes”, you can use 2D colliders with a 3D game. The long answer is that some things wont work that way, and some things will.

  • Detecting mouse clicks = generally fine with a 2D collider
  • Detecting if two objects intersect = you might have some issues with 2D colliders
  • Using very small collider areas = 2D colliders have some bugs that 3D colliders do not have

I am actually making a side scroller “2.5D” game myself. It is 3D models from a side perspective. So what the other poster here said is correct. There are bugs/issues you will run into but it is possible. In all honestly, though, you might want to avoid it.
I honestly have not played with a hardcore 2D game in Unity myself. But one thing I can tell you just from working with making a crosshair appear on the screen in a 3D environment with objects firing at the position of the mouse, well, it was extremely difficult and time consuming. When you are trying to make 3D objects interact with 2D objects, you get into some very complicated physics at times. Even when using Unity’s simple functions, documentation, and framework, things can be very finicky and frustrating.

2D/3D mixtures generally involve “raycasting”, a word in my top five most hated words of all time. Raycasting involves the tricky of where, one object that is close to you and not in 3D space has to intersect/interact with objects in a 3D space. So if you fire a rocket in 2D space on your screen and are trying to hit a 3D object -10 units on the z axis for example, you are going to have a somewhat difficult time pulling it off.
If you have a lot of 3D objects but want a 2D game, what you can do is use 3D planes. Planes are 3D but you can put 2D graphics on them and they can still collide easily with other 3D objects. I even use them in my game, and they are nice because they scale with Unity units so your objects will look good on all screen sizes. The downside is that it will be somewhat difficult to get teh sizing/scale of your 2D graphics to proportion correctly on planes.

I highly recommend you experiment first before committing yourself to a game with a combination of 2D/3D collisions because some of the physics behind it can get a bit complicated. Good luck.

The trick is remembering that colliders are used to fake where something counts as being. The way it looks and where the collider says it is are independent. This can be a little confusing, since Unity tries to add the “correct” collider to objects – but we know we can delete the free box collider on a cube, add a sphere collider, and it works just fine. Or we can have an 3D spaceship model, but using a sphere collider (which is good enough for weapons fires and crashes.)

A basic 2D game could start with 2D colliders with colored squares moving around. Then you’d add better textures or sprites with transparency, keeping the colliders the exact same since you liked that gameplay. Or, add 3D models, also with no change to gameplay.

As @Kiwasi has mentioned, it will be okay as long as there are only 2D colliders. I tried and tested it recently.
Also, in my research, I learned that 2D colliders and 3D colliders can not interact with each other. And since we can not have both on the same game object, in case you want both to interact with one another, a workaround would be to add an empty child to any of the objects, say the 3D collider object, and use that empty object to detect any collisions with other 2D colliders.