Search Unity

Bug Timeline animation offset is broken.

Discussion in 'Timeline' started by Whatever560, May 19, 2023.

  1. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I have a unit and want to move it around while having an animation played, animation does not have a root motion.

    I tried absolutelly all the possible combination off :

    1. Root Motion On / Off on character
    2. Apply transform offset / Scene Offset / Auto
    3. Blend animation clips with Two different Clip offset | override track that moves the character
    4. Even if no root motion : Clip import with Root set as root node | Root to None with no bake | Root None with all bake.

    They absolutelly all work in edit mode. Absolutelly NONE work in playmode.

    https://forum.unity.com/threads/tra...review-mode-but-they-dont-in-playmode.492442/
    https://forum.unity.com/threads/track-offsets-apply-scene-offsets-cannot-adjust-this.938438/
    https://forum.unity.com/threads/tim...animationclip-and-offset-frustrations.480869/
     
    Last edited: May 19, 2023
    drspecial likes this.
  2. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    So. You have to remove the character animator for it to work ... should be handled by timeline really.
     
  3. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    A common solution when two animators fighting for control is to put the character under and empty game object. Then move the character by animating the empty object, and character animations get applied to the child. Avoids these “last one wins” fights.
     
    Whatever560 likes this.
  4. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Thanks for the idea. However still unable to make rotation offsets if the child had a position offset. I still believe this is flawed.

    Also disabling the animator is instant so blending is quite not working. Well its all very hacky where it looks like a real common thing, I mean so many usecase would like to do this.
     
  5. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I did add a parent however it still is bugged. Whenever I move the parent object the animated character slides back to the scene position. It's infuriating.

    I checked my StateMachinesBehaviour, only one have a OnStateMove implemented, but it returns directly and does nothing so it should not interfere.
     
  6. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I did a transition to a state without a SMB, the offset now works directly on the unit animator, but only with transform offset (does not offset when scene offset is set)

    Also there is a huge delay for the application of the offset even though the unit is already in the correct state. Does not make much sens ...
     
  7. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Ok so, I'm still wondering why an empty OnStateMove tempers with timeline.
    Anyway, exiting the state earlier allowed for a shorter delay.

    So basically if you want to move an animator that have a root motion animation you need to :
    - Set Track offset to Transform Offset
    - Be in an animator state that have no SMB with a OnStateMove set, regardless of it doing anything.

    It's quite constraining, Anyone got this working with Scene Offset ? (So I can offset from any position in the scene)
     
  8. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519