Author Topic: Unity animations are not working  (Read 4899 times)

grofie

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 17
    • View Profile
Unity animations are not working
« on: January 28, 2014, 11:00:51 AM »
Hi Aren,

our game developper prefers to make animations over the unity editor instead of using tweens. This works fine for manipulating the transform values of an UI element. But i.e. changing the color brings strange behaviours. When changing a label or sprite color over the inspector, the change can be seen in game immediately. However, when it is changed by the unity animation, the color in the inspector changes but not in the game. Only on some rare moments, the color does change in game but without any interpolation.

What are we doing wrong? Is there an extra option to set?

Thx in advance and kind regards,
grofie

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unity animations are not working
« Reply #1 on: January 28, 2014, 11:33:59 AM »
You need to use an intermediary script as Unity doesn't offer a way to animate properties -- only variables, and it picks up hidden variables such as "MColor", which are private and should not be edited.

UIAnimatedColor, UIAnimatedAlpha -- look at these scripts and how they get around the problem. Attach one of them and animate their values instead of the widget's.

grofie

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 17
    • View Profile
Re: Unity animations are not working
« Reply #2 on: January 29, 2014, 05:43:40 AM »
Merci beaucoup  ;D