Search Unity

Is there a way to create infinite clip of transform of the object on runtime?

Discussion in 'Timeline' started by Lafsody_UrniqueStudio, Oct 30, 2019.

  1. Lafsody_UrniqueStudio

    Lafsody_UrniqueStudio

    Joined:
    Mar 2, 2013
    Posts:
    11
    We are trying to create Timeline on runtime.
    The animation track is working well.
    The transform track we try to using infinite-clip to control position and rotation. It seems working well. But only in the editor. After we build the transform track doesn't work at all.

    We receive this in the log file.

    Can't use AnimationClip::SetCurve at Runtime on non Legacy AnimationClips
    (Filename: C:\buildslave\unity\build\Modules\Animation\AnimationClip.cpp Line: 1297)

    In document says SetCurve doesn't work with non-legacy and non-editor.

    But, is there any workaround?
    using
    clip.legacy = true
    before SetCurve does not work even if on editor.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No, there isn't. It is a limitation of the animation system. The best alternative is a custom track that writes directly to a transform using Animation Curves, but that won't interact as well with the animator as an infinite track.
     
  3. Lafsody_UrniqueStudio

    Lafsody_UrniqueStudio

    Joined:
    Mar 2, 2013
    Posts:
    11
    Thank you very much.
    Maybe we need to use the native method by mapping transform with time from scripts.