Search Issue Tracker
Won't Fix
Votes
0
Found in
2022.3.61f1
6000.0.47f1
6000.1.1f1
6000.2.0a10
6000.3.0a1
Issue ID
UUM-104607
Regression
No
Euler angles return different values during Animation Event when using Playables API and the time is 0
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Enter the Play Mode
4. Wait a few seconds for the characters to face forward
5. Click the mouse to play the shoot animation
Expected result: Red character shoots the capsule in the same direction it's pointing
Actual result: Red character spawns the capsule pointing off to the side
Reproducible with: 2022.3.61f1, 6000.0.47f1, 6000.1.1f1, 6000.2.0a10
Reproducible on:
Play Mode
Windows Standalone Player
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Notes:
- Character with animator spawns capsule correctly
- Both use the same character, capsule, and animation. The only difference is that this character uses Animancer, which is based on the Playables API
- On the frame where the event occurs, the Euler angles are fine during Update and LateUpdate, but during the Animation Event, it gives a completely different value
- Moving the Animation Event's time to any other value seems to avoid this issue, it only occurs with the event at exactly time = 0.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- WebGL build dependencies are not refreshed until the Editor is restarted
- “Audio Random Container” allows adding unlimited number in “Audio Clips” numeric field, causing Editor to freeze
- In Deferred rendering path, mixed lights don't render when enabling "Use Rendering Layers" in the Decal renderer feature
- [Windows] Special characters in file names are sorted to the end of the alphabet in the Project window
- Information box icons are not contained within the information box bounds in Render Pipeline Converter window
Resolution Note:
Hi,
Thanks for reporting this issue. After looking into it, we’ve figured out what’s happening and wanted to explain why it works this way, along with how you can work around it.
When an animation event gets triggered, the animation system hasn’t updated the character’s transforms for that frame yet. At that point, the character is still in the pose from the last frame (plus any other changes that happened since then). Normally, this isn’t noticeable, but in cases where there’s a reset (like a SoftResetBindings), the character temporarily goes into the default pose.
This behavior happens in a few situations:
1. Entering Play Mode when the first frame has an animation event.
2. Switching an Animator Override Controller.
3. Using Playables APIs to change the animation graph (e.g., connecting/disconnecting playables, adding new playables at runtime, like Animancer.Play does in this use case).
The issue comes from how the animation system processes things. Animation events are fired before the transforms for the current frame are updated. So, if you trigger something like a particle effect or a bullet spawn during the event, it’s using outdated transform data.
Workaround
To avoid this, you can delay anything that depends on the updated transforms (like spawning particles or bullets) to LateUpdate. By then, the Animator will have fully updated the character’s transforms, so you’ll get the correct behavior. This approach is generally better anyway and avoids timing issues.
This isn’t really a bug, it’s just how the system is designed to work, and it’s consistent across other cases (like switching Animator Override Controllers). Fixing this would require a big change to the animation system, and since there’s a solid workaround, we’ve decided not to address it right now.
Additionally, trying to address this on our side would carry a very high risk of introducing new issues in other use cases, which is why we’re sticking with the current behavior.