Search Issue Tracker

Fixed in 2022.2.X

Votes

0

Found in

2019.4

2020.3

2020.3.25f1

2021.2

2022.1

Issue ID

1390997

Regression

No

Editor crashes when an AnimationEvent is created via script and played by a Legacy Animation

Animation

-

How to reproduce:
1. Open the user-submitted project
2. Open the scene "SampleScene" (Assets/Scenes/SampleScene.unity)
3. Enter Play mode

Expected result: An Animation Event is played after 8 seconds
Actual result: The Editor crashes after 8 seconds

Reproducible with: 2019.4.34f1, 2020.3.25f1, 2021.2.7f1, 2022.1.0b2

Stack trace:
#0 0x0000010d2a33f6 in FireEvent(AnimationEvent&, Unity::Component&, AnimationState*, AnimatorStateInfo*, AnimatorClipInfo*)
#1 0x0000010d2900c8 in AnimationState::FireEvents(float, float, bool, Unity::Component&, float, float, bool)
#2 0x0000010d29041b in AnimationState::UpdateAnimationState(double, Unity::Component&)
#3 0x0000010d26479d in Animation::UpdateAnimation(double)
#4 0x0000010d2dc9cf in AnimationManager::Update()
#5 0x0000010d2dcce2 in AnimationManager::InitializeClass()::PreLateUpdateLegacyAnimationUpdateRegistrator::Forward()

  1. Resolution Note (fix version 2022.2):

    Adding an event in the event handler will no longer cause a crash. It is important to note that the case was a user error. The event that the user would add in the event handler would be executed instantly, creating another event over and over, ending with a stack overflow, crashing the unity editor. Could a play queued be used here instead? https://docs.unity3d.com/ScriptReference/Animation.PlayQueued.html

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.