Maybe someone can help me out when using DOTween Pro with Unity 5 and uGUI :).

I have a standard unity panel in the center of my screen (not full screen width/height, using it as a pause menu popup) and I have an anchor point in each corner of the panel. With that setup the panel scales to the device screen when I build and run the application on my android device. I set a way point to move the panel off screen on application start and then it slides back on screen when user presses the pause button.

It all works fantastic in the editor, but on my android device it looks as though the anchor positions did not stay in the original positions and the panel is skewed off to one side, so much that it is barely visible on the screen. If I remove the DOTween component the panel is visible on the center of the device, just like in the editor. Please see attachments.
« Last Edit: May 22, 2015, 09:18:02 PM by jprocha101 »

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Hi!

Are you using a path to move your panel? If so, I apologize, because you're the second user doing that, and I'm currently working on it. I didn't think someone could use paths with UGUI, since it's actually not recommended (simply because Unity's UGUI is a very heavy thing, so paths should be used with sprites or regular non-UGUI objects). So paths use transform.position and not rectTransform.anchorPosition, which is a completely different thing.

While I work on allowing paths with UGUI (which might take a while because UGUI anchorPositions break the paths logic), you could simply use a DOTweenAnimation + DOMove instead. That will correctly use anchorPositions. Just be careful to grab the latest version of DOTween Pro.

That worked! Thank you very much.

A different issue though, I seem to only be able to execute the tween one time each. Then calling it a second time does nothing. I deactivated auto kill but it still did not work. Do you see anything wrong with the component setup?

Thanks!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
What are you using to play it again? I suppose you're using DOPlay, but that won't work because the tween has already played, so you'll need to use DORestart instead.

Also, I have a suggestion, considering that you practically have the same tween, just going in different directions. Instead of having two tweens, you could have only one. Then, when you want to play it "forward", you call DOPlayForward, and when you want to play it backwards you call DOPlayBackwards :)