Search Unity

Animated Values still locked after completion of timeline Sequence

Discussion in 'Timeline' started by Egyptman09, Jul 10, 2018.

  1. Egyptman09

    Egyptman09

    Joined:
    Nov 16, 2016
    Posts:
    7
    I have a cutscene that plays on awake using timeline. It manipulates various values like the lighting and the player's transform through an animation clip using key frames set in timeline. Once the timeline ends all these values remain locked and can't be changed by the player controller or other scripts.

    Im not sure why the values are still locked even after the Timeline is complete and the Wrap mode is set to none. Iv tried deleting the timeline after its complete and they are still locked and cant be changed even when the timeline no longer exists.

    I assume this behaviour is not intentional, how can I fix this?

     

    Attached Files:

  2. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Can you please open a bug with a small repo project? that way it will be easier for us to figure out what might be happening.

    thanks
     
  3. Egyptman09

    Egyptman09

    Joined:
    Nov 16, 2016
    Posts:
    7
    sure but part of my question is if this even is a bug or is this intentional??

    You can reproduce this easily with anything, just put any value of any component under a timeline, key framed animation and it will be locked for the entire time in play mode even after the timeline is complete. It is so easy to achieve this bug that im thinking im missing something and this is normal? is it haha??
     
  4. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Depends, maybe I don't really understand what is your issue. So I'll try to explain how Timeline works.
    When you hit play in a timeline or if you scrub with the playhead there is a functionality called Preview that get triggered and enabled. Its pretty much the same kind of preview that the Animation window uses. This is necessary so you don't change the values of your transforms on a GO forever. If you disable the preview, you'll see that the object is reset to it's original position.
    If you try to change transforms when preview is enabled you' ll notice that the values have a blue (or red if your are in record mode) background. if it's blue and you try to change the value, it will obviously get reset to the value of the animation playing. If it's red, a keyframe will be added to your timeline. But if you disable preview in timeline and change the value, it will change it outside of Timeline.

    Not sure if it's clearer?
     
  5. Egyptman09

    Egyptman09

    Joined:
    Nov 16, 2016
    Posts:
    7
    Thanks for your help so far btw :)

    Yes I understand all that but I am referring to the behaviour of all this but in play mode. Ill explain what my cut scene does exactly further. The cutscene which uses the timeline above is animating the lights in the scene in order to start at night and by the end of the cutscene it is day time. I control the lights mainly through a lighting manager script on an object in the scene. This script has a value called global ambient which controls the ambient in the scene on all my objects. This number when used in timeline is locked, i cannot change it after the cutscene is complete in play mode. If the timeline is never played the number is not locked and I can change it normally (again all this in play mode). I understand the number is locked to prevent changing it manually since timeline is in control of it during the cutscene but why is it still locked with the blue color on it even after the timeline is complete and even removed from the scene?

    I am not too worried about the lighting value being locked but I am worried about another value I control through timeline which is the players position. Because its locked my player controller no longer work since it cant move the transform due to the lock.

    The lock in red or blue that you are referring to I understand but what im saying is this lock is not removed in play mode when its not in preview mode. I can remove the lock in edit mode normally by disabling preview mode yes but in play mode when the cutscene plays on awake the timeline engages the lock with the values and does not remove that lock even when the cutscene is complete meaning the values that are animated in the timeline cannot be changed unless from timeline itself
     
  6. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Seems that something isn't right, you should be able to change values. please share a project with maybe a video of what you are trying to do. It will be easier for all of us here. It might also be a setup issue so in any case, I good repro will be a good thing to have
     
    Egyptman09 likes this.
  7. Egyptman09

    Egyptman09

    Joined:
    Nov 16, 2016
    Posts:
    7
    ok so figured it out. It is in fact a bug but I fixed it. Below is a link to a project that recreates the bug and a video of me creating the bug to help you guys in fixing it. Soz in not being able to show you the bug in my game to speed up to process, its under NDA so I might get in trouble ;)

    https://drive.google.com/file/d/14uWmjLGfTNff0uM2Uc9rH55gp28_tLOV/view?usp=sharing

    For anyone who is stuck on this, the issue is in the animator. Do not attach an empty animator controller to the animator component of the animated object. Yes you need an animator component on the animated object for timeline but the animator component does not need an animator controller in it. If you have one in it causes this bug.
     
    zIyaGtVm likes this.
  8. Quantumstorey

    Quantumstorey

    Joined:
    Jun 1, 2017
    Posts:
    9
    For those who are searching this issue, it's: record mode is enabled, but no keys are recorded.

    The problem persists in Unity 2020.2.6

    It allows recording mode to be enabled in timeline, and in animation window, yet no keys are recorded and no warnings are thrown in log. The fix is to add the clip you're editing to the animation controller. It doesn't need to be connected to anything, it just needs to be there. After adding it to the animation controller, record mode works as expected.

    This should have a warning. The record button turns on as expected, but it never warns that you're animating a locked object. This makes record mode act the same as preview mode.