Author Topic: Animating UISprite color via Unity Animation doesn't work.  (Read 5044 times)

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Animating UISprite color via Unity Animation doesn't work.
« on: January 24, 2014, 03:55:28 PM »
As we tried to animate our game's crosshair, we tried to animate the colors and it did nothing! D:

Any ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Animating UISprite color via Unity Animation doesn't work.
« Reply #1 on: January 24, 2014, 10:15:51 PM »
You can't animate private variables. "mColor" is a private variable.

Use the intermediary script -- UIAnimatedColor

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Re: Animating UISprite color via Unity Animation doesn't work.
« Reply #2 on: January 24, 2014, 10:39:20 PM »
 Hey, thanks Aren. =)

Also, are there similar scripts for animating widget's width and height?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Animating UISprite color via Unity Animation doesn't work.
« Reply #3 on: January 24, 2014, 10:52:33 PM »
No, I generally recommend using tweens instead of animations. There are tweens for most things.

But if you are so inclined, just copy/paste the script that does the color animation and replace color with width. It's a really short script.

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Re: Animating UISprite color via Unity Animation doesn't work.
« Reply #4 on: January 24, 2014, 10:55:22 PM »
Ok.

Thing is, our animator would like to make the animations for our GUI himself, and he says "Tweens are awful to animate properly". haha

I'll keep that in mind. =)