Author Topic: Moving UIWidget and regular Unity objects : Ok, now that's weird.  (Read 2081 times)

Docteur Cox

  • Guest
Hello there !

So here's the problem. I have an issue with UITables. When repositioning them, I got something weird happening with widgets seemingly keeping the same position and textmeshes (I have no choice but to use them for that project unfortunately...) having the right offset. So I decided to try something out. I wrote that simple coroutine :

  1. IEnumerator MoveCategory(UITable table)
  2.         {
  3.                 while ( true )
  4.                 {
  5.                         Vector3 trans = table.transform.position;
  6.                         trans.y += 0.3f*Time.deltaTime;
  7.                         table.transform.position = trans;
  8.                        
  9.                         yield return new WaitForEndOfFrame();
  10.                 }
  11.         }

And the least I can say is that the result is kind of unexpected: My text flies above UIWidgets while the last remains static. Or to be more accurate : my game objects move while the UIWidgets are still rendered at the very same position. In fact, when I select them in hierarchy, objects with UIWidgets are moving along other objects and are exactly where they should be but are not rendered at the right place.

What did I possibly do wrong to get such weird stuff happening ? :o  How can I fix it ?

Thanks in advance ! :)
« Last Edit: July 18, 2013, 09:20:25 AM by Docteur Cox »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Moving UIWidget and regular Unity objects : Ok, now that's weird.
« Reply #1 on: July 18, 2013, 09:51:39 AM »
Remove the "widgets are static" flag from your UIPanel.

Docteur Cox

  • Guest
Re: Moving UIWidget and regular Unity objects : Ok, now that's weird.
« Reply #2 on: July 18, 2013, 10:03:53 AM »
Erf, I feel like really dumb now, but it works ! Thanks ArenMook  ;D