- Home /
2D collision detection in 3d games
Is there any way to configure the 2D collision detection onto the x,z plane for use in 3d games? As it is, 2D collision detection is done on the x,y plane which would be rather awkward to use in a 3D game..
(I'm considering making a forum suggestion.)
Not sure i follow... What's wrong with using the 3D collision detection...?
There is no real problem with rotating your entire game so that the x, z plane is the ground.
I'd imagine 2D faster, you may not need full 3D collision detection, Wargame series(IRISZOO$$anonymous$$ engine) uses 2D collision detection in some aspects.
As it is transform.up is basically transform.forward for 2D objects. Same silliness with other Vector3 stuff, but it's easy enough to use a static class for those.
Just a thought. Wouldn't it be more logical?
Also, I just noticed, the 2D collision box (green outline) acts like it's being rotated but the detection happens as if the rotation is zero, so you can't set the size visually.
Correction, it doesn't occur normally, and terrains can't be rotated, so this is basically a dead end unless you're going to project your state onto a 2D representation.
Your answer
![](https://koobas.hobune.stream/wayback/20220613154527im_/https://answers.unity.com/themes/thub/images/avi.jpg)