playMaker

Author Topic: Position difference between UI in Unity and in Built  (Read 1178 times)

kaplovski

  • Playmaker Newbie
  • *
  • Posts: 4
Position difference between UI in Unity and in Built
« on: January 13, 2020, 09:34:15 AM »
I have a big problem. My unity project is pretty much done, with all menus and buttons done in UI. Most of the game runs in the UI canvas. However, whenever building, many things appear to have been anchored in the left bottom with the centre of the screen as their origin. Except when the anchored position is being controlled by the animator, then it is displayed correctly.

in unity


in build


see attachments.

This problem is pretty much the only thing holding me back from building

kaplovski

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Position difference between UI in Unity and in Built
« Reply #1 on: January 13, 2020, 09:37:17 AM »
and in build it looks like this:

« Last Edit: January 13, 2020, 09:41:52 AM by kaplovski »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Position difference between UI in Unity and in Built
« Reply #2 on: January 14, 2020, 02:45:13 AM »
Hi,

 how is this UI element positionned? your inline images in your post are not working unfortunatly.

Bye,

 Jean

kaplovski

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Position difference between UI in Unity and in Built
« Reply #3 on: January 14, 2020, 12:13:12 PM »
the ui elements are anchored to stretch to all sides of the screen in UI canvas. However, when building, the ui elements appear to be moved half a screen to the right and half a screen to the left. It's as if the entire object is reanchored bottom left and then the position is reset to 0.
I can fix the problem by adding a set rect transform action to the starting state of each of these ui elements with the value x and y = 0. So I managed to hack a fix together but I don't think it's supposed to behave this way.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Position difference between UI in Unity and in Built
« Reply #4 on: January 21, 2020, 08:11:15 AM »
Hi,

 indeed not, could it be your canvas Scaler that is set up wrong?

start again from scratch with a simple scene and work it out this way. that's how I would debug this.

Bye,

 Jean