playMaker

Author Topic: Why is uGUI object offset to the right?  (Read 1170 times)

oneki

  • Playmaker Newbie
  • *
  • Posts: 3
Why is uGUI object offset to the right?
« on: November 05, 2016, 07:25:00 AM »
Heyo.

I'm trying to set location of Rect Transform to where I click/touch.

Problem is when I click in lower left corner it puts the object in the center, instead of that lower left corner. As I click around the screen the object follows a rectangle, it's just offset by the 0.5 of the screen?

Any idea how to fix that? Have been scratching my head over this for a while now.

http://imgur.com/a/51rM4

oneki

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Why is uGUI object offset to the right?
« Reply #1 on: November 05, 2016, 08:08:38 AM »
http://imgur.com/a/CNwpx

On the right is Scene view showing the position of object, when I click in the center in the game view.

Canvas is set to screen space - camera. Changing it to world space doesn't really change the behaviour, just brings in the object closer to camera (makes it look bigger).

oneki

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Why is uGUI object offset to the right?
« Reply #2 on: November 05, 2016, 09:22:15 AM »
Finally solved it!

Problem was in using Rect set local position instead of Rect set anchor position.

http://imgur.com/a/tXzLb