-1
\$\begingroup\$

Today I made a Unity 2D app with a square moving around and I wanted to know why is the alignment on the left.

Here are some screenshots:

Game seen from the play preview

Game seen from the visual editor

Game seen from the built file

\$\endgroup\$
3
  • \$\begingroup\$ It could be a problem with how you set up your Camera component. Did you perhaps mess with the viewport rect? \$\endgroup\$
    – Philipp
    Apr 2 at 14:00
  • \$\begingroup\$ @Philipp yes, i did \$\endgroup\$
    – berriz
    Apr 2 at 14:04
  • \$\begingroup\$ @Philipp guess i have to change the x and y because i changed w and h \$\endgroup\$
    – berriz
    Apr 2 at 14:05

1 Answer 1

0
\$\begingroup\$

I set my camera viewport viewport rect to W 0.5 and H 1.
I had to change the X to half of W.
So if you change the W then you need to change your X to half of W, and if you change the H then you need to change Y to half of H for the viewport to be aligned in the middle.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .