Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Animation Event triggering 50 to 100 ms late. Is this common?

Discussion in 'Animation' started by iLoveGamesDeveloper, Oct 3, 2023.

  1. iLoveGamesDeveloper

    iLoveGamesDeveloper

    Joined:
    Aug 8, 2019
    Posts:
    14
    Hello,

    So I'm going to use animation events to generate a small VFX to let the player know when to let go of a button to win a crit when attacking.

    From what I have investigated, Animation Events are reliable, but in my test, I have some that are not, and I'm trying to figure out why. I have five animation events which are just printing a message to the console. In this example, I'm triggering an event at launch, when the star appears, when the star turns yellow, when the star disappears, and then when the clip finishes. The first two are working fine, but the last three are not. The most worrisome ones are the third- and second-to-last ones as they are indicators for the player.

    This is a screenshot of the set up. It does not say much, but basically as soon as there is a change in the attributes of the star, an event will be triggered.

    upload_2023-10-3_9-59-13.png

    I recorded a video slowed down to x0.20 to show the difference that I'm attaching. The yellow star event seems to be triggered almost 80 to 100 ms after and the star disappearing triggers around 50 ms late. Is this expected? Any advice?
     
  2. iLoveGamesDeveloper

    iLoveGamesDeveloper

    Joined:
    Aug 8, 2019
    Posts:
    14
    I created another video where I walk frame by frame showing the preview vs the play mode of the animation so you can see the difference which is quite noticeable (I understand a couple of frames difference but the triggering is so much different).