- Home /
Can I set Animator State Transition defaults?
Hey all,
So I'm working on a project with a lot of animations, and therefore a lot of animator transitions. For most of these I want hasExitTime to be false, but by default it is true. So is there any way to change its default value?
Might have something to do with AnimatorStateTransition but not sure where or when to change that.
Thanks for any help!
Thanks for asking this. This frustrates me too, I almost never use Exit time and it usually messes me up because I have forgotten to turn one off.
I see why it is the default in the comments of the answer below - but I just wanted to add my voice to the amount of frustration this causes me. I maybe need Exit Time = true possibly 1% of the time. Even if I want it to play at the end of the animation I usually use a trigger because I have found issues with using Exit Time.
Answer by luislodosm · Jan 21, 2019 at 09:32 PM
Make a new preset.
This shows how to create the preset, but to make a preset the default, I'm assu$$anonymous$$g you have to hook it up in the Project Settings -> Preset $$anonymous$$anager somehow, but I can't find the correct type to put it under. Any ideas?
This is not good because the stores the target state too, which I obviously want to be different every time I use the default settings. Also, as @markkv12 pointed out, making a preset is not the same as setting a default.
Answer by GrayMatterTutorials · Jan 09, 2017 at 10:34 PM
@Fanttum, of course you can! You just have to click on the check box within the transition between 2 animation states. This is done within the Animator Controller. You will need to provide another condition seeing as hasExitTime is a condition that gets met for the transition to know when to change to the new state. I hope this helps, feel free to ask more questions and I will try to help out as much as possible.
I know how to change it manually, but every time I make a new transition I would like the actions I already do manually to be done for me, or set by default.
That just changes the exit time condition of the selected transition. I believe the OP is asking how to change the default value, so that any new transitions are created with false, for example. Unfortunately, I don't know of any way to override those default parameters, so I think it must be done manually on each transition.
$$anonymous$$y apologies for misunderstanding. There isn't nor could there be a way to change it by default. The reason it is there is to be the default condition to change the animations. Without it, the animation would never change unless manually stating that there is another condition. This of course wouldn't cut down your workload at all. Grant it, it's a pain in the neck, but it's a fail-safe to make sure that the animator functions properly. In most cases you wouldn't think it would be a problem, but when 10+ animations are chained together to occur one after the other, it would be quite an annoyance if you had to go in and change every transition to have the default "has exit time" when you just want to test the animations. Now if you don't, I can see why you would want that to be the case, but even then, you would just have to create a default Boolean value that you will probably end up getting rid of anyway? You could be conditionless, like I stated earlier, but the Animator controller was designed to animate and any moment where there is a transition without conditions is much less than ideal! So unfortunately, no, but there's good reason for it being there! A new way of creating transitions where it automatically popped up with a conditions list would be cool, I just don't foresee that happening!
That can make sense to have Exit Time enabled by default, but there are a lot of less critical parameters one could want to change. For instance, I wished I could set the default Exit time to 1 (ins$$anonymous$$d of the default 0.7) and set the default Interruption Source to "Next State"
Answer by NLindblad · Oct 19, 2018 at 08:15 AM
Made a context menu script that changes transition parameters to a specific value for RuntimeAnimatorControllers:
https://gist.github.com/Ryxali/33fa23ec833b2b64aae88e616e0f03bb
Maybe you can find a way to re-purpose it?