- Home /
Is there any way to make the default animation transition instant?
I'm making a 2D game and having to constantly set the transition times to 0 in the animator controller thing is really really annoying. Is there any way to set it to automatically do this? so that when i create a new transition it automatically changes the transition time to 0. Or is the any way to set the default transition time?
Answer by Galaxyzd · Aug 30, 2018 at 08:08 AM
I've been wondering the same forever. The default transition duration of 0.25 often feels very clunky and I'd love to be able to set a default for it. Sorry I didn't answer your question but let's get some activity on this thread so maybe someone who knows how to do this sees this?
Answer by NLindblad · Oct 19, 2018 at 08:00 AM
A bit late to the party, but created a script that adds a context menu to the RuntimeAnimationController:
https://gist.github.com/Ryxali/33fa23ec833b2b64aae88e616e0f03bb
It currently sets: Has Exit Time: 0 Fixed Duration: True Transition Duration: 0 Transition Offset: 0
You can tweak these in the script.
Note that this will overwrite all transition parameters. So it's less a default and more an enforced standard.
I added the script but nothing changed, new transition still has default value. How do I use it?
It's a context menu item, so if you right click the AnimationController -> Enforce Transition Settings
So it's a manual operation you can include in your workflow to ensure everything has the correct transition parameters. I'd advise you to backup your AnimationController before trying this though, as this is a very hacky solution that might break your asset depending on Unity version. You also need to ensure your assets are serialized as texts as well.
If you want it automated you could experiment with running the code on certain triggers, such as when the asset is saved, or before building or entering playmode.