Author Topic: Why does UIDraggable Panel "magically" move on game start??  (Read 2637 times)

agentsmith666

  • Guest
Why does UIDraggable Panel "magically" move on game start??
« on: October 07, 2013, 03:06:43 PM »
I have a UIDraggable Panel  that has a position of 0,0,0.  It has soft clipping and the clipping size is 250 x 250.  I have a child UIGrid with a position of 0, 0, 0 and an arrangement of vertical.  Cell width and height are 200.   There is a child of the grid; a sprite with a UIDragPanelContents script attached.  Pretty simple... I hit play and the UIDraggable Panel changes it's position  -60, 0, 0 and then it changes it's soft clip center to 60x-60.  Why does this happen?  If I initialize all the properties with these "magic" numbers, so it basically is starting in the wrong position and hit play it will not move and continue to stay in this "wrong" position. 

Update:

If anyone else ran into this problem here's a link to the answer.  It's mentioned at 06:15:

http://youtu.be/OiA4o8KqBFI?t=6m15s

« Last Edit: October 07, 2013, 03:47:09 PM by agentsmith666 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Why does UIDraggable Panel "magically" move on game start??
« Reply #1 on: October 08, 2013, 01:40:17 AM »
Did you watch this video?

http://www.youtube.com/watch?v=OiA4o8KqBFI&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

It explains why the content may move, and how to fix it.

agentsmith666

  • Guest
Re: Why does UIDraggable Panel "magically" move on game start??
« Reply #2 on: October 08, 2013, 01:57:12 AM »
@Aren-  Yes thanks, its actually the same video as the one i posted. :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Why does UIDraggable Panel "magically" move on game start??
« Reply #3 on: October 08, 2013, 02:00:48 AM »
Ah, totally missed the "Update" part. :)