Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question How can you blend between two playable assets?

Discussion in 'Timeline' started by laenseloe, Jul 5, 2023.

  1. laenseloe

    laenseloe

    Joined:
    Mar 17, 2015
    Posts:
    5
    upload_2023-7-5_14-45-38.png
    I use timeline to build up my skill resources, so I can define some custom function like "rotate to target", "attack window" and so on
    But when there goes a combo, like SkillA to SkillB, I don't know how to make these two animations blend, the SkillB just animated suddenly after SkillA finished, how do you guys fix this problem?
     
  2. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    588
    I would also like to know. Especially for action oriented games, I'd like to streamline my particle effects with my sword slashes. While timeline has allowed me to do so and very efficiently, I can't seem to get 2 playableassets to blend with each other. I've seen various threads dating back to 2018 saying this feature was being worked on with no word since.
     
  3. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    140
    Here's a script that let you set the timeline's animation weight. This only applies to animation, you can't blend other kinds of playableAssets.
    TimelineAnimationWeightSetter - Github (only the
    TimelineAnimationWeightSetter.cs
    script is needed)
    You can blend between 2 Timeline Animations by easing the second timeline's weight from 0 to 1.
     
    Pixelith likes this.
  4. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    588
    That's pretty Interesting! I'm going to give the code you linked to a try.
    Thanks!
     
    Yuchen_Chang likes this.
  5. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    588
    Just wanted to stop in and say I tried to make a sort of PlayablesAnimator manager, where I used 2 directors and a coroutine to try and blend them by setting the weights. It sorta worked, but ended up being more work than what it was worth.
    For my project, I think I'm going to continue forward with using animator and instead try to make my own tool to preview and activate particles with animations. I'll do camera work with clever tweening or something.The TimelineAnimationWeightSetter script is still pretty handy though since I can use it to blend my finishing moves back to the animator.
     
    Yuchen_Chang likes this.
  6. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    588
    I ended up making my tool.
    Took a little bit of time and research but it's essentially doing what I want.
     
    Yuchen_Chang and tsukimi like this.