brunomikoski / Animation-Sequencer

A visual tool that allows you to create animated sequences of tweens and tweak them on editor time.
MIT License
960 stars 116 forks source link

Canvas Fade no longer works at runtime in 0.5.0 #57

Closed timbo-tj closed 2 years ago

timbo-tj commented 2 years ago

Hi there!

Just updated to 0.5.0, canvas fade is no longer functional at runtime. I can downgrade and verify it works in 0.4.0!

Steps image

0.4.0

https://user-images.githubusercontent.com/84851611/191885514-30fb56e8-f74d-4a02-b2b7-fa0a8338c9f5.mp4

0.5.0

https://user-images.githubusercontent.com/84851611/191885538-d623e72d-0721-4cf8-b02f-bf61bacc5b5c.mp4

timbo-tj commented 2 years ago

Unity 2021.3.10f1 here

timbo-tj commented 2 years ago

I can confirm it is 'playing' correctly in 0.5.0 - the position is being changed correctly but the Alpha of the Canvas group is unchanged!

https://user-images.githubusercontent.com/84851611/191885825-5b2d5d45-7848-4ee3-a4f7-af043f20caa6.mp4

brunomikoski commented 2 years ago

I will double-check! Looks like Unity changed a few stuff in 2021 on how they set graphics as dirty! A fix should arrive soon!

It should work fine in playtime btw, just previewing on editor will be like this.

timbo-tj commented 2 years ago

It should work fine in playtime btw,

Oh no, unfortunately the videos above are in play mode! :(

brunomikoski commented 2 years ago

It should work fine in playtime btw,

Oh no, unfortunately the videos above are in play mode! :(

Outch! Okay I will look into it asap.

timbo-tj commented 2 years ago

In the meantime for anyone else having issues: I was able to downgrade to 0.4.0 and it seems to work fine (No data loss here). Though my project isn't very complex, so backup before you do try it..!

brunomikoski commented 2 years ago

I just tested with Unity 2021.3.8f1 Sequencer: 0.5.1 DOTween: 1.2.632

And looks like is working fine here. If you can, could you please create a small reproduction project so I can take a closer look.

timbo-tj commented 2 years ago

Ofcourse, I will do so tomorrow as I am wrapping up for the day.

timbo-tj commented 2 years ago

I was able to figure out the problem.

So far, I drive all but a few of my AnimationSequencerControllers through code (Calling Play when needed). However I had left all of them on auto play 'awake' (I don't think there was any other option in 0.4.0?)

I am not sure what changed between 0.4.0 and 0.5.0 but for whatever reason the auto-playing animations were causing my buttons to enter a state where their alpha property was not being driven properly any more when I tried to Play my AnimationSequencerController

I guess we can chalk this up to indeterministic behaviour... Within the span of a single frame the button was under the influence of 3 different AnimationSequencerController 'Play' operations:

  1. I spawn the popup containing the buttons
  2. The popup's Intro AnimationSequencerController plays on Awake (Unintended)
  3. The popup's Outro AnimationSequencerController plays on Awake (Unintended)
  4. Then I immediately call 'Play' on the popup's Intro AnimationSequencerController as part of my popup setup code. (Intended)

Setting all the AnimationSequencerController's Autoplay modes to Nothing if I intended to control it via script fixed the problem with my button alpha.