Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Help with camera!

Discussion in '2D' started by Astrididad, Sep 13, 2018.

  1. Astrididad

    Astrididad

    Joined:
    Sep 13, 2018
    Posts:
    1
    So I am new to unity and I am attempting to make a 2d game. I am having problems with the camera not picking up my project.

    This is what it should show.


    upload_2018-9-12_18-15-2.png


    This is what it shows now.


    upload_2018-9-12_18-15-48.png
     
  2. Benvictus

    Benvictus

    Joined:
    Sep 12, 2013
    Posts:
    87
    Set the camera's z position to -10.

    The camera is not rendering the sprites as they are on-top of them. It's like taking a step back in order to get a good view.
     
  3. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    739
    2D views use X and Y for left-right, up-down.

    Z is for depth. Negative Z values = towards you, into the screen.

    So a Z value of -10 drags the camera back towards you, so it can look into the scene, where your 2D objects sit at zero on the Z axis.

    Unity is inherently a 3D space. So when you want to "zoom", you can change the distance of the camera from your plane of action, by changing the Z position of the camera.

    Similarly, you can instantly get a 2.5D view by moving the camera's target to an X,Y position that's not quite the same as the camera itself. This gives perspective to your 2D objects on their XY plane.
     
    MisterSkitz likes this.
  4. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    You may not need 1000 depth on your far clipping plane since your camera most likely will be close. I use 20-50 far and 0.1 near. In 2D mode, it's easy to get too close to the action lol

    The good news if you are lost, click out 2D mode in your Scene, click on one of your active tiles in the hierarchy and then press F for focus. Your map should pop up. (If that was an issue for you.)
     
    Deeeds likes this.
  5. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Their camera is orthographic. Changing its position on the Z axis won't give a zoom effect. To achieve zoom, you change orthographic size. Orthographic size is equal to half the size of the camera's vertical frustum. So the more orthographic size, the more you can see and less zoom.
     
  6. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    739
    You missed the word "can".
     
  7. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    I did? I'm not sure I understand?

    Edit: I got you. But you can't with an orthographic camera, nothing will happen. You can change the z all you want, the only thing that will happen is objects outside of clip space will no longer render.