Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there a way to change multiple Animator Controller transitions at once?

Discussion in 'Animation' started by godsammit, Nov 10, 2018.

  1. godsammit

    godsammit

    Joined:
    Nov 10, 2018
    Posts:
    1
    I have an animator controller with over 50 animation transitions. I want all of the transitions to occur at the same speed. Naturally, I tried to select them all, and then change the slider, but it only actually affected one transition. Am I missing something or is this just something Unity isn't capable of doing?
     
  2. leftshoe18

    leftshoe18

    Joined:
    Jul 29, 2017
    Posts:
    61
    There are certain elements of the animation system that aren't compatible with multi-editing. This just might be one of those things.
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,554
    Things like this are a big part of why I made Animancer to replace animator controllers. Everything is much more flexible when done with code.

    That said, this particular issue has a simple solution. Delete all your transitions and the parameters controlling them and use CrossFade or CrossFadeInFixedTime to transition to the state you want, which lets you specify how long you want it to take in code.

    Another option would be to write an editor script that casts the RuntimeAnimatorController to an editor AnimatorController which lets you access its states and transitions, so you can set their time in that script.
     
  4. JohnnyConnor

    JohnnyConnor

    Joined:
    Aug 10, 2020
    Posts:
    42
    Most animations parameters can only be multi-edited by modifying your animator asset with a text editor that features a replace functionality (Ctrl + H in VS Code).
    In your case, you would need to look for the “m_Speed:” lines and replace them with your desired value.
     
  5. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,364
    @JohnnyConnor , this thread was dormant for five years. The forum doesn't automatically stop you from necro-posting but the people involved aren't interested in this topic anymore. While your solution of editing Unity/YAML assets is an interesting new bit of information, it's not a recommended practice.
     
  6. JohnnyConnor

    JohnnyConnor

    Joined:
    Aug 10, 2020
    Posts:
    42
    I disagree of this view because this page was the first result I got while I was having the same problem as his. It would have saved me some time if someone had posted that answer here before. I believe that if people don't post new solutions they find to an old problem, the likelihood of a duplicate question being posted at some point in the future will increase.
     
    saiph300 likes this.