Author Topic: Animating Panel Alpha is Inconsistent  (Read 2616 times)

DCalabrese

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 23
    • View Profile
Animating Panel Alpha is Inconsistent
« on: December 10, 2014, 08:47:59 PM »
Looks like a possible bug, but here we go. I'm using classic Unity animations to animation the dialogs in my game. Everything is working great - except for panel alpha animations. In many cases it works, however for some UIs, it simply just doesn't animate. When previewing the animation while editing, and alpha value of the panel always animates - but get it into the game, and it almost seems to be a 50/50 chance on if it will work or not.

Is this a known issue? Or is animating panel alpha something I shouldn't be trying to do? :)

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Animating Panel Alpha is Inconsistent
« Reply #1 on: December 11, 2014, 09:03:34 AM »
You're animating a private, hidden variable, "MAlpha". The fact that Unity shows it to you is a bug in Unity.

When working with NGUI, you should be working through properties, and Unity doesn't let you animate properties.

Solution is simple -- use an intermediate script. It's called AnimatedAlpha. Attach it, animate its alpha value instead.

DCalabrese

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: Animating Panel Alpha is Inconsistent
« Reply #2 on: December 11, 2014, 04:55:18 PM »
I had a feeling I was just doing it wrong - that works perfectly! Thanks ArenMook!