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. Dismiss Notice

Question Custom camera shape/viewport

Discussion in '2D' started by icyfiremario797, Aug 28, 2023.

  1. icyfiremario797

    icyfiremario797

    Joined:
    Jun 16, 2023
    Posts:
    1
    I'm trying to recreate The Legend of Zelda on NES in Unity for an AI project I'm working on and I can get the camera to be the right shape. The problem I'm having is that I can't seem to figure out how to have the camera fit the size of one tile of the map. Every change I make to the camera is symmetrical, making it impossible to get the specific size I need. I have provided pictures of what i am using for reference and the result.
     

    Attached Files:

    • tmp.png
      tmp.png
      File size:
      13.4 KB
      Views:
      14
    • tmp2.png
      tmp2.png
      File size:
      55.3 KB
      Views:
      13
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    All I see difference-wise is the scale is different and you haven't put the UI across the top yet.

    Review the Camera docs for how to configure orthographic mode and what .orthographicSize property means in terms of world coordinates.

    Beyond that...


    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, log output, variable values, and especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven't put effort into finding the documentation, why should we bother putting effort into replying?



    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/

    - Do not TALK about code without posting it.
    - Do NOT post unformatted code.
    - Do NOT retype code. Use copy/paste properly using code tags.
    - Do NOT post screenshots of code.
    - Do NOT post photographs of code.
    - ONLY post the relevant code, and then refer to it in your discussion.