Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Is that possible to modify timeline's actor position & rotation ?

Discussion in 'Timeline' started by canis, Jan 2, 2021.

  1. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    79
    Attempt to use timeline to override my character's animator to platform jump action.



    Q: right now I need to know how to modify the position and rotation of timeline.
    can anyone point me the way ?

    What I'm trying to do here, is allow my script to modify the apex or the landing coordinate during the timeline play.

    =======================
    I find something may useful,
    but the problem is I had no idea how can I access there...
    upload_2021-1-2_15-29-52.png

    I know
    TrackAsset can locate in TimelineAsset.GetOutputTracks() by track name.
    and then
    foreach TimelineClip clip in TrackAsset.GetClips()
    but I can't find "Clip Transform Offsets" is that thing can help me to finish these feature ?
     
    Last edited: Jan 2, 2021
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    If you know where the Apex is supposed to be, and when you're supposed to hit it, you can use a script to modify the root motion of the Animator to gradually adapt the movement.

    Are you trying to read the transform offsets or write them?
     
    canis likes this.
  3. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    79
    thanks, you are right and I'm using your solution right now.
    to manually override my CharacterController, instead of mass with timeline.

    however I did find the way to access AnimationPlayerableAsset..
    it's hiding in TimelineClip.asset, since it's type of Object, I need to cast it back to the type I wanted before override it's value.
    here is example.

    Code (CSharp):
    1. public IEnumerable<AnimationPlayableAsset> GetAnimationPlayableAssets(TrackAsset track)
    2. {
    3.     foreach (var clip in track.GetClips())
    4.     {
    5.         AnimationPlayableAsset ani = (AnimationPlayableAsset)clip.asset;
    6.         if (ani != null)
    7.             yield return ani;
    8.     }
    9. }