Search Issue Tracker
Fixed in 2019.2.X
Sampling the position of the GameObject with Update function does not yield the correct position
Steps to reproduce:
1. Open attached project "ConstraintBugReport.zip"
2. Open the "ConstraintBug" scene
3. Press Play
Expected results: Sphere follows "ConstraintBugTimeline" GameObject.
Actual results: Sphere visibly lags behind "ConstraintBugTimeline" GameObject.
Reproduced in: 2017.4.20f1, 2018.3.5f1, 2019.1.0b2, 2019.2.0a4
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- The Scene\Game view is grey when two "Universal Additional Camera Data" scripts are attached to the camera
- NullReferenceException error thrown when changing Scenes in Play Mode
- Crash on "'anonymous namespace'::ConvertFBXShapes" when importing an FBX file
- Crash on Transform::RemoveFromParent when Object.DestroyImmediate() is called on Transform
- [Linux] Player consumes more CPU resources when it is running in the background
Mar 06, 2020 15:11
Hi @silverbackalex, you cannot Update an FBX animation + Timeline in a character that has attached a *ParentConstraint*. Since the ParentConstraint is performed before LateUpdate in an internal function called PreLateUpdate.
Thus, if you Update the Timeline in the LateUpdate the position of the Character will be already constraint at that moment. Practically, It's too late for animating the position.
The best approach will be using Update instead, and if you require to do that later of all Update callbacks, you may use the Script Execution Order Settings to add the script after the default time.
I hope you may find this information useful.
Feb 27, 2019 20:21
I don't know if it matters, but this title is a bit misleading. This issue pertains specifically to constrained GameObjects , and LateUpdate; not regular GameObjects and Update.
The inability to sample animated GameObjects in Update is normal; you can sample them in LateUpdate.
This issue concerns objects bound by the AnimationModule's Constraints - such as ParentConstraint and PositionConstraint. Objects so constraint can't be sampled correctly even in LateUpdate.