Animation Event can't work in low frame rate...Help.....

i have added some event to the animation.As high frame rate it works well,but when the frame rate too low the event missed sometimes…
who can help me to fix it

get your framerate to the point where it does not go through 2 frames in a single frame skipping yours totally. either that or play the animation slower …
what also helps is attempting to have a fixed framerate thats equal or multiplies of the animation framerate (lets say animation framerate of 30 and target FPS of 60)

how could i fixed my framerate…i have no ideal how to control the framerate.
as what you said,it skipped the frame of AnimationEvent and i can’t prevent it? so,any other way to do with animation event?

“either that or play the animation slower …” do you mean that set the speed of the animation slow when it’s low framerate ?

Sorry to dig an old thread, but is this sync problem resolved nowadays ?

AnimationEvents could be an ultra powerful tool for many game features, but if it’s synced with the fps, it’s clearly not reliable.

Isn’t there some kind of security, checking the event to trigger based on time elpased since animation start ? That would solve the sync problem …

Ok, I’ve tested AnimationEvents with a forced 10 FPS webplayer, and it worked perfectly.

It’s reliable.

As far as I know animation events should be framerate independent. File a bug if they are not.

Thank you for your feedback.
I suspect that some AnimationEvent are still not triggering correctly under highly stressed out performances, when both GPU and CPU are put to the ground.
As it is not happening systematically, and under some heavy graphic/code loading, filing the whole project could unveil some confidential info.

I’ll make plenty of tests to isolate the function and check if it really comes from AnimationEvent, but if it is, how could I help without sending the whole project ?

Then you should try to make a minimal project and just try to create a heavy load in it somehow (just doing a lot of matrix multiplications could work, or maybe plain delays could reduce framerate too). We really need (and appreciate) good bug reports, otherwise everyone’s time gets waisted.

Ok, I’ll provide a useful file as soon as possible, thanks.

I’m seeing this as well, Unity 3.3.0f (63049) build.

I had noticed that my game seemed to “hang” sometimes but found it was from errant animation events (I drop the character and play a “landing” animation at start, which in turn calls a OnLandEnd() method to release control to the user).

Also noticed this today while using my internal video card on my M17x (don’t buy one, ever) - added some additional logging and confirmed this, VERY sporadic and tough to reproduce.

Anyhow, thinking i’ll avoid using animation events as the only means of exiting code - which is a real shame since it would be a very elegant way of handling state changes for my code. I’ll probably get the clip duration and use as an offset to the current time as a guard condition (hard cutoff) for forcing an OnLandEnd() call if not already called.

this issue seems to stil be hiding somewhere for us to on 3.4.1 :frowning:
we’ve tracked down one cause for this random occurrence, being that multiple instantiations of a GameObject housing the AnimClip the event-placement-code houses are adding the same animEvent each time another GameObject of that type is instantiated.

As a workaround tht I tried, copying the keyframes of the final frame and pasting them in either side of the final frame helps. When ever the game running at low fps skips the final frame, it means that one of the frames near the final frame is rendered but not the final frame. If we copy and paste the keyframe in the above manner the final frame will apparently be rendered (or any of the adjacent frames where we copied the keyframes).

To further dig up a very old thread and to help anyone with similar problems as @abhishekm942 : In the case of the event being at/in the final frame, be aware of your transitions. By default they come with a non-zero transition and exit time. If you happen to have low FPS or a missconfigured transaction, the last frame(s) can sometimes not actually be rendered/called. This is not dependend on low FPS alone. An event in the middle of an animation will work just fine with low FPS. But a transition can acutally skip some frames and that seems to apply to events aswell. I had this “bug” (it’s not a bug, it’s indeed a feature, no sarcasm) a few weeks ago in Unity 2020.1.6f1, and was able to resolve it completely by setting my exit transition to be 0 frames long. In my case I actually needed a zero time transition, but a better approach would be to just use State Machine scripts for events at the end of an animation.

TLDR: Events and Animation Transitions don’t play well together. Use State Machine scripts if you encounter to many problems with that.

none of the above solutions worked, if I put 10 fps by force - the animation event almost never fires …

1 Like

Has this bug been fixed?
I wanted to add events, but I thought that due to the fast FPS, some frames would be skipped. I decided to clarify this on the Internet and ended up here.
Is this still happening in the latest versions 2021-2023?

Late 2023 here and it still happens… My falling animation doesnt trasition to land/running on low FPS.

1 Like

2023.2.9.f1 this problem exists, i am discouraged (It seems like this problem only exists if the animation is looped)

I seem to be having the opposite problem. I was testing my game on low fps via Application.targetframerate and when I go down to 10, animation events get called twice.
I slowly increased fps to 20, where it still happened. On 30 it only happened occasionaly. I found somewhere to activate Animate Physics in a really old bug report, but that doesn’t fix it either.