Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Timeline animation don't apply the rotation to the gameOject

Discussion in 'Timeline' started by Pierre-Marie, Oct 28, 2022.

  1. Pierre-Marie

    Pierre-Marie

    Joined:
    Aug 3, 2015
    Posts:
    52
    Hello evryone,

    I making my first try with the timeline tool and find a very strange situation.
    My timeline is composed of a moving camera ( transform), a moving characters( transform) and that same character using animation.

    I cheked the rout motion. At the end of the timeline, the transorm position is correctly update as the last timeline frame transform position of the characters. That's good,but the rotation go back to the inital value ( befor the start of the timeline).

    upload_2022-10-28_15-22-46.png

    If I had to set the rotation manually after every timeline it's going to take me Ages.

    There is the characters hierarchie.
    upload_2022-10-28_15-26-33.png

    and this is the playable Director:
    upload_2022-10-28_15-28-22.png

    the animation track about the transform modification of the characters :
    upload_2022-10-28_15-29-16.png

    I'm not sure why there is offset as my characters is correctly place at the begging of the timeline.
    Those Offset are strange as they match for the position part but not for the rotation part.

    ( see chaarcter position )
    upload_2022-10-28_15-30-35.png

    Changing this offset change the starting rotation of the characters at the firstf rame of the timeline but at the end it still go back to the caracters initial rotation.

    It's not easy to understand how the timeline really work in tried a lot of combinaison using the different option that don't seem to change so much things.

    Thank's for your help.
     
  2. Pierre-Marie

    Pierre-Marie

    Joined:
    Aug 3, 2015
    Posts:
    52
    Hi I solved this probleme by using a "fake player".
    I have another game Object that is the "actor player" wich is basicly just the mesh of the player.

    In my timeLine a add two signal.
    the start signal end the end signal.

    The start signal desable the true player and enable the actor.
    The cut scene use the actor to display animation.

    upload_2022-10-31_15-17-58.png

    At the end of the timeline the end signal switch the actor and the real player.
    A made a script attached the the "timeline" gameObject wich on desable teleport the real player to the last position of the actor and apply the rotation.

    I use the nav mesh navigation so I teleport the player by using "agent.Warp(position);"

    upload_2022-10-31_15-21-3.png


    upload_2022-10-31_15-21-59.png

    upload_2022-10-31_15-22-15.png

    A little bit more of work but work better than trying to use the real player with all the scripts attached in the cutscene.
    Hope that can help someone.
     
    akent99 likes this.