Search Unity

Question Make some UI stay the same size when moved

Discussion in 'UGUI & TextMesh Pro' started by VadanaPon, Nov 12, 2022.

  1. VadanaPon

    VadanaPon

    Joined:
    Jul 5, 2022
    Posts:
    45
    I have the canvas set to World Space and the camera to perspective,
    I need a way for some elements to have a constant size, like if they were in orthographic view, i would like to know if that's possible

    Currently if i move the ui back and forth it looks like it changes size because of the camera projection, like this:
    ezgif.com-gif-maker.gif

    Since i'm using a world space canvas, i have to sort the object by moving them closer to the camera, which makes the ui grow and shrink, making the grids be all of different sizes

    I could use an orthographic camera, but i like the effect the FOV gives to the UI.
    I would appreciate any help or ideas on how to make this work
     
    Last edited: Nov 12, 2022
  2. VadanaPon

    VadanaPon

    Joined:
    Jul 5, 2022
    Posts:
    45
    I think i found how to solve it, i made another canvas for the elements i want to be orthographic and then synced their positions using WorldToViewportPoint, but the problem now is that it's giving me the wrong position

    Edit:
    Nevermind, the new canvas is always rendering on top, which i don't want, i think i'll have to go full orthographic
     
    Last edited: Nov 12, 2022