Search Unity

Is there any way to copy and paste transitions between animation states?

Discussion in 'Animation' started by Nanako, Oct 8, 2014.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Hi all. Pretty much as title.

    I have states A, B, and C. And the conditions for transitioning from A to B, or from A to C, (or from B to C) are almost identical. It would save me time and effort if i could cop and paste the transition data, as a new link between two different states, and then just add whatever extra conditions are needed
     
  2. TD10074405

    TD10074405

    Joined:
    Aug 23, 2014
    Posts:
    35
    If you only have Three states, its not too bad, wait until you have something like this:
    states.png
    in which all the "Crouch" states are the same.

    AFAIK there isn't a way to copy and paste them, I tried. Many times.
     
  3. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    ouch, wow. That... does not look good.

    when it gets like that, i wonder if i might feel incluined to dump the blueprints and do it by script. That'd probably be easier for complex logic.

    I wonder though, can't you use a blend tree for all those crouch states ? If the conditions to get into them are mostly the same, then you'd just need to differentiate within the blend tree, the more specific conditions for each crouch state.
    or maybe i have no clue what i'm talking about, i'm just fresh from tutorials after all :p
     
  4. TD10074405

    TD10074405

    Joined:
    Aug 23, 2014
    Posts:
    35
    I was using blend trees but because each of the transitions has more than one state they started to mess up slightly and we were getting a running motion when a crouch was supposed to be happening-

    In the near future we hope to get the tree sorted out and smoothed using blend trees but for now whilst we're getting ready for public alpha, its fine!
     
    Nanako likes this.
  5. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Hello, I don't know if you've found solutions to your problems since this thread is pretty old, but I was facing the same issue and i think I might of found a solution! I discovered that that if I drag a network of states and transitions that I want to copy into a state machine. I can then copy the state machine with all my transitions intact and drag them out to hook into my original blend-tree. Hope this helps!
     
    TheHobbyist likes this.
  6. muzzl

    muzzl

    Joined:
    Feb 2, 2018
    Posts:
    3
    Yes you can copy and paste transition settings.

    To do so:

    - Click the state with the transition in the animator.
    - Find the transition in the inspector under the selected state's list of transitions.
    - Right click the transition.
    - Pick "Copy Transition Parameters"
    - From then on, the popup will also allow you to paste the settings, conditions, or both, when right clicking on another transition.

    Important: Make sure the inspector is showing the state with the transition and not the transition itself.
     
  7. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Thanks. Also possible from transition itself. (2017.4.2f2)

    upload_2018-7-6_12-41-21.png
     
  8. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    too bad the "can transition to self" does not get copied!
     
  9. ig-swapnilwelling

    ig-swapnilwelling

    Joined:
    Jan 24, 2020
    Posts:
    4
    Hey, this helps alot!! what I would like to also know is that if we copy parameters such as trigger names or do we have manually add them.... and then paste both settings and conditions.
    I hope there is a way to do this

    I know this is an old post but hoping to get some help on it since its related thanks
     
  10. aegis123321

    aegis123321

    Joined:
    Jul 5, 2015
    Posts:
    71
  11. zrocweb

    zrocweb

    Joined:
    Dec 19, 2016
    Posts:
    43
    Nice job dude. Helped alot for one of my problems.

    Have another problem where I need to copy an entire layer(states, transitions, animations,etc) from an assets controller to my characters main controller. Is there anything you know of that will do that. I've been looking for awhile now and haven't been able to find anything.
     
  12. aegis123321

    aegis123321

    Joined:
    Jul 5, 2015
    Posts:
    71
    Maybe you should try Animator Override Controllers?
    Or if it doesn't work to you, the feature what you need might be not hard to do by just writing a script. I will do that if I have time.
     
  13. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    302
    Thanks for sharing this awesome tool. Exactly what I was looking for. You deserve way more cred. What a time saver!
     
  14. n2oukdnb

    n2oukdnb

    Joined:
    Aug 28, 2022
    Posts:
    3
    omg thanks, this totally solved a frustrating problem with my game that I've been trying to figure out for hours! Erroneously thought it was to do with my code.
     
  15. darketernal666666

    darketernal666666

    Joined:
    Dec 22, 2020
    Posts:
    11
    I want to make use of this tool, but i'm a bit of a noob, i don't know what or where to download. Isn't there a unity package that i can download? Sorry for being so blind.
     
  16. aegis123321

    aegis123321

    Joined:
    Jul 5, 2015
    Posts:
    71
    I just added an unitypackage in releases:
    https://github.com/qwe321qwe321qwe321/Unity-AnimatorTransitionCopier/releases

    Alternatively, you can install it via Unity Package Manager. See the "Getting Started" section for details.
     
    shasaur_unity and cmdexecutor like this.
  17. TheHobbyist

    TheHobbyist

    Joined:
    Nov 24, 2014
    Posts:
    19
    Solid solution!