Search Unity

Can't move gameobject after timeline completes

Discussion in 'Timeline' started by Gregwar, Jan 17, 2019.

  1. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    I'm not sure if I'm missing something here, but it seems that if you have a custom animator controller on a gameobject, put that gameobject into a timeline and attempt to move its position using the timeline; the object will be unmovable once the timeline completes.

    I've tested this with a brand new project, using a gameobject that only has a sprite renderer an animator and a custom anim controller that only consists of a single sprite. I test if the object can move by attempting to change its transform position in the scene after the timeline completes.

    If I disable and re-enable the "Animator" component, the object will be movable again. Also if I clear the "Animator->Controller" field for "None (Runtime Animator Controller)" this issue does not occur

    Does anyone know why this would be happening? It's a big issue for me since I want to move my playable characters position in a timeline, and continue controlling it after the cinematic.

    This is in a 2d project
     

    Attached Files:

  2. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    173
    Hi,
    When you say unmovable, you mean that it wont budge at all or that it is reset to it's position?
    A small clip might help to understand the issue.
     
  3. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    Sure, I'll post a clip when I'm back at my computer tonight.

    For now when I say unmoveable, I mean it resets its position if you try to move it. For instance, if you click on the game object in the editor, type in a new X value to the transform.position and press enter; it will immediately reset the position to where it was.

    If I enable / disable my animator at this point and try the same test, then the gameobject will properly move to my defined value
     
  4. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    Here's a clip of what I'm seeing. The square is being moved from left to right using a timeline. Once the timeline has finished. I cannot change the squares position unless i disable and re-enable the animator
     
  5. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    173
    Interesting, I wasn't able to repro here unfortunately, if you can open a bug with the attached project and post the bugid here, I will be able to track it down

    sorry about that
     
  6. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    I created a bug report for this and uploaded the project twice today. Each time I got a notification saying that "It was successfully uploaded and should receive an email shortly". However after waiting all day, I haven't gotten an email from either attempt.

    Maybe you can find it in the backend?
     

    Attached Files:

  7. jonasj_unity

    jonasj_unity

    Unity Technologies

    Joined:
    Jul 4, 2018
    Posts:
    2
    Hey Greg,
    I can see that there is a project attached to your case, it's okay :)
     
  8. dandawes

    dandawes

    Joined:
    Jan 25, 2013
    Posts:
    4
    Hi, I'm also experiencing this bug but can't find it in the issue tracker. It's like the animation clip that I have on my timeline doesn't clear it's bindings properly and therefore is constantly setting the game objects position.
     
  9. dandawes

    dandawes

    Joined:
    Jan 25, 2013
    Posts:
    4
    I tested in a similar scene to Greg and can recreate this. Not sure if this is the same as Greg's issue but if you:
    -Add cube to scene,
    -create playdirector and animator using the button in timeline,
    -Add animation track, assign cube and add a couple of movement keyframes.
    -Play anim, cube moves and when finished cube can be moved - this all works fine.

    To break it:-
    -Add a separate animator controller and assign it to the cube's controller
    -Play anim and when finished cube cannot be moved

    So I think it's to do with having 2 different animatorcontrollers. We ended up caching the runtimeanimatorcontroller and setting it to null. Then in the animator stopped callback we reassign it to the cached controller and all seems to be back to normal. Hope that helps.
     
  10. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    Thanks for the reply dandawes, that's the exact issue i'm seeing. If the animator controller is empty, this issue does not occur. If I have an animator controller assigned, then the gameobject cannot be moved after the timeline sequence completes.

    Caching and re-assigning the controller is what crossed my mind for fixing this too, but it sounds like a work around to a bug in the timeline feature.

    I've been emailing back and forth with unity's bug team in attempt for them to see why this is bad... but so far no luck. The issue id I opened is 1118708, but apparently it can't go public until their QA team acknowledges it as an issue

    Just to re-iterate what the issue is here:
    A timeline that is no longer playing should not override the position of a gameobject that is using an animator controller.
     
    Last edited: Jan 29, 2019
    dandawes likes this.
  11. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    883
    Thanks for the updates on this. I've been following up on this with the animation team, and I've followed up with QA, and the issue filed by @Gregwar should be officially opened up as bug very soon.

    Resetting the animator controller is a good workaround for now. We've been incorrectly assuming this bug was a change in behaviour between 2018.2 and 2018.3 where animator & timeline underwent a lot of animation changes with regard to root transforms. Turns out, the bug exists in 2018.2.

    It appears that once the animator starts writing the root transform (on behalf of timeline), then the state machine continues to always write the root transform even when the state has no root transform animation. Resetting the state machine, as @dandawes pointed out seems to fix it.
     
    dandawes likes this.
  12. Gregwar

    Gregwar

    Joined:
    Jan 5, 2019
    Posts:
    9
    That's great to hear, thanks everyone for the help!
     
  13. Un3mpathic

    Un3mpathic

    Joined:
    Jan 23, 2018
    Posts:
    2
    Hi, I am still experiencing this issue in 2019.1f
    Any updates on this?

    Can confirm that by reactivating the animation on the object "releases" the object again.
     
  14. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    883
    I don't believe there is a bug fix to address this yet.
     
    Un3mpathic likes this.
  15. jonasj_unity

    jonasj_unity

    Unity Technologies

    Joined:
    Jul 4, 2018
    Posts:
    2