Search Unity

Question Creating and Modifying Blend Trees in runtime?

Discussion in 'Animation' started by rafael_unity386, Dec 11, 2023.

  1. rafael_unity386

    rafael_unity386

    Joined:
    Jun 15, 2022
    Posts:
    14
    Hey everyone.
    So I had a script that I used to change a Blend Tree’s clips and change the thresholds. I had public fields to assign the Animation Clips and then the Blend Tree would be automatically adjusted with those new clips. But then I realized that the script wouldn’t work on builds because BlendTree is part of the UnityEditor namespace. Is there a way to rewrite the script retaining the same functionality without using UnityEditor?
     
  2. tsukimi

    tsukimi

    Joined:
    Dec 10, 2014
    Posts:
    80
    You could use Playables, which is a lower level API that AnimatorController uses (and finally blend tree results is output to playables), but you have to write your own animation managing scripts in that way.