playMaker

Author Topic: Problem with UI Button and Animation / Animator  (Read 1516 times)

ilovelessons

  • Junior Playmaker
  • **
  • Posts: 70
Problem with UI Button and Animation / Animator
« on: April 15, 2017, 09:41:47 AM »
Good Day,
I have made a UI button and attached the anchors to one corner of the canvas so when I have a different size screen it will maintain its general position (This works fine). Attached is some pics of how it looks at 2 different screen resolutions (Picture_1)

However, I am trying to add animation to the buttons using the Animator. So this is what I did in the inspector. Please note the animation were done as sequential sprites.  This is how my INSPECTOR looked (Inspector Picture) I had to add Sprite Renderer to get the animation to show.  However this is what if looks like now when I used different screen sizes (Picture_2).

Why doesn’t the sprite stay inside the Button Area? Shouldn’t the animator be where the button is? Does anyone know to resolve this issue? Using or not using playmaker?


It seems once you add a sprite to any UI object it no longer obeys the anchors. Why is this ?

Thanks





elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Problem with UI Button and Animation / Animator
« Reply #1 on: April 15, 2017, 02:26:10 PM »
Can you post screenshots of your transform?

ilovelessons

  • Junior Playmaker
  • **
  • Posts: 70
Re: Problem with UI Button and Animation / Animator
« Reply #2 on: April 15, 2017, 03:34:17 PM »
elusiven,

I actually just changed my canvas to "World Space" mood and all my problems just went away :S... I don't know what made me try it..

I have a question though.. if in Play Mode in unity if I try ALL the resolutions from the drop down menu and it looks good in the game preview area for all .. does this mean it will look good in real life on all phones?  In other words can the Game Preview area we trusted?

Are there any programs out there online that allow you to upload you built game and have it simulated on different phones?

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with UI Button and Animation / Animator
« Reply #3 on: April 19, 2017, 06:27:46 AM »
Hi,

 I would like to tell you that it does, but my experience is that you must deploy on the device you want to distribute with, else you will hit trouble, once you have verified the UI works you will likely be fine on that matter though.

Have you checked the asset store ? something like : https://www.assetstore.unity3d.com/en/#!/content/10563

 Bye,

 Jean