- Home /
Change from 3D to 2D
Hi folks, I recently started a new project, but I'm stuck on one key asset of the game.
I want to switch from a 3D perspective to a 2D one, so all the objects in the 3d scene are brought to the front, and can be interacted with as if they were 2D. It's a bit like "Super Paper Mario" in which you can go in 3D and move around freely, but once you go in 2D there are alot of things in your way. (One example of this here)
I've tested some things out but can't really find a good solution, any help would be appreciated.
This would be a 3D view of the scene, as an example And this would be the 2D perspective, and the player will be able to jump from the small block to the large block without problem, which he couldn't in 3D.
Answer by Pixelguy627 · Jun 06, 2019 at 08:49 PM
While I haven't tested this, I believe an easy way to accomplish this would be to put both a 2D and 3D collider on both the player and the objects, turning off whichever one you don't start in at first. When you swap between the dimensions, you can turn those that are not in the current dimension off, and those that are on.
For a less confusing explanation, if you start in 2D, and you send some command to swap to 3D (trying to generalize because I don't know what input you'd be using), you would disable all 2D colliders and enable all 3D colliders, so you would collide with only those in the current dimension, if that makes any sense.
You can change whether a collider is disabled or enabled by setting collider.enabled
to whatever you want ( collider.enabled = true;
to enable, collider.enabled = false;
to disable).
Oh wow, I did not realize how old this is. Sorry for answering such an old question!
Your answer
Follow this Question
Related Questions
pixel perfect 2d Sprite in 3d world with isometric camera, how to do it right? 1 Answer
Restrict 2D camera with a Quad? 0 Answers
Why does my app function correctly in Unity Remote but not compiled as an app? 0 Answers
Stop character from moving out of camera sight 1 Answer
2D Minimap with 3D Globe 0 Answers