Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Timeline and script on objects

Discussion in 'Timeline' started by ManAmazin, Jun 21, 2020.

  1. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    hey guys,

    ok so I have been diving more and more into timeline and came across a roadblock sorry if this seems obvious..

    so im using timeline to repeat moving an object from side to side, I also put a simple script on said object to rotate on a certain axis.

    The problem is that timeline invalidates the script on the object and was wondering is that by design and i cant get around it or am i doing something wrong?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    If you are using the animation track to translate the object from side to side, it will also write the rotation. This is a limitation of the animation track.

    If your script rotates the object in a LateUpdate() call, then you can overwrite the rotation written by timeline.
     
  3. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    ok, thanks for the info sean will give it a whirl!.
     
  4. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    Maybe im doing something wrong, change rotate line of code to LateUpdate and it still isnt rotating?
     
  5. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    scratch that, wrapping it in another gameobject fixed it for me, thanks again! @sean_unity
     
unityunity