Search Issue Tracker
By Design
Votes
0
Found in
2022.3.60f1
6000.0.45f1
6000.1.0b13
6000.2.0a8
6000.3.0a1
Issue ID
UUM-102252
Regression
No
The beginning of the Animation doesn’t start at the correct position when it's being enabled through a Trigger event and the Physics Simulation mode is set to "Update"
How to reproduce:
1. Open the attached “IN-98417” project
2. Open the “SampleScene“
3. Enter Play mode
4. Select the “Player” GameObject in the Hierarchy window and use the WASD keyboard buttons to change its position until it touches the “triggerCube” GameObject and enables it in the Game view
5. Keep changing the “Player“ position to switch it between touching the “triggerCube“ GameObject and not touching it
6. Observe the results of the “animatedCube“ GameObject in the Game view
Expected result: The animation starts playing smoothly
Actual result: The animation doesn’t start at the correct position at its start
Reproducible with: 2022.2.0a17, 2022.3.60f1, 6000.0.45f1, 6000.1.0b13, 6000.2.0a8
Couldn't test with: 2022.1.0a10, 2022.2.0a9 (there isn't a Simulation mode under the Physics tab in the Project Settings)
Reproducible on: MacOS 15.3 (M4), Windows 11 (by user)
Not reproducible on: No other environments tested
Notes:
- Reproducible in Standalone Player
- The issue reproduces if the “triggerCube“ GameObject is enabled using “OnTriggerEnter“ or “OnTriggerStay“
- Changing the Simulation Mode to "Fixed Update" (in the Project Settings > Physics tab) stops the issue from reproducing
- Changing the Culling Mode of the “animatedCube“ GameObject (in the Inspector window > Animator Component) from “Always Animate“ to “Cull Update Transforms“ or “Cull Completely“ stops the issue from reproducing
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
- Specular lighting visible in a camera with Path Tracing when Preserve specular lighting is disabled in observed material
- Cinemachine package throws CS1061 errors in the Console when installed in a project that has HDRP and URP installed
- Editor.log file size grows rapidly when a scene exceeds the "Maximum Shadow on Screen" limit setting in the HDRP Asset
- Player build freezes after calling Application.Quit() when the scripting backend is set to IL2CPP
- Texture is not applied on a Custom Render Texture when a Cubemap is selected as the texture
Resolution Note:
This happens because animation evaluates after physics when it's evaluated in the Update loop. Because of that, animation is not evaluated right away during the first frame where the game object is made visible.
To fix that issue, you can evaluate animation manually during the LateUpdate loop instead. Write a MonoBehaviour script and add it to your Cube gameObject. If you call `GetComponent<Animator>().Update(Time.deltaTime)` during LateUpdate, you'll animate the cube after Physics has evaluated. Make sure to disable the Animator component so that it's not evaluated automatically.
You would get the same issue if Physics were updated in FixedUpdate and the Animator Update Mode would be set to FixedUpdate as well.