Change the camera from 2d to 3d on a click of a keyboard button.

Hi there. I was wondering if there is a way to change the way the camera views the scene from 3d to 2d. I would like to make a platformer that can change from 2 dimensions to 3 dimensions. If this is not very clear, do feel free to ask for clarification. Thanks for your time and help!

The way I want it to work is if the player presses the “return” key, the camera will change its dimension from 2 to 3.

There is a way to do that. Cameras have a property called ortographic that changes their mode. If you want a smooth transition you are probably better off using fieldOfView and change those values.

You need to get a reference to the camera (if you only have one, that would be Camera.main). Then you can just use some conditional checks on an Update() method of your script that checks if a button is pressed. If you don’t know how to do that I highly recommend you search some tutorials on the internet / YouTube. There are a lot of button tutorials out there.

Thanks so much! I will give it a whirl and get back to you!