Search Unity

Animancer - Less Animator Controller, More Animator Control

Discussion in 'Assets and Asset Store' started by Kybernetik, Oct 8, 2018.

  1. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Try copying the implementation of the StartTime field from the ClipState.Transition class. If that does what you need I'll add it to Animancer v5.0.
     
  2. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    i encounter a situation that when i play layered sprite animation across multiple SpriteRenderer (using AvatarMask), but it didn't give me the right outcome, when subLayer's weight greater than 0.5, all transform/renderer are effected(not only the masked one), but when weight is less than 0.5, renderer.sprite became None, quite weird though...
     
  3. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    also i have another question about custom sprite mixer, let's say, i have two clips(A and B), each of them have 8 frames(same length), when i play, i want to randomly swap between them, e.g.

    1. A1
    2. B2
    3. A3.
    4. A4.
    5. B5.
    6. B6.
    7. A7.
    8. B8.

    does this easy to achive this intepolation/mixer behavior through Animaner?
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I don't have much experience with Sprites, but that sounds like the behaviour I would expect. If you cross fade between two animations it can only show one of their Sprites at a time, so it will just show whichever one has the higher weight. But generally there is no point in cross fading between Sprite animations, so you likely just want to play them instantly.

    Swapping between animations like that would be easy using a Linear Mixer State with synchronisation enabled for all its animations.
     
  5. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    Thx for the reply!

    for the first one, i may misrepresent the question. let's say, i have a rig like this:

    - Root(Transform) ==> BaseLayer
    ---- Body(Transform and SpriteRenderer)
    ---- Arm(Transform and SpriteRenderer) ==> ArmLayer
    ---- Weapon(Transform and SpriteRenderer)

    my animation clips do change all Transforms and SpriteRenderers, then i have two of them:
    Run and Attack, when i play Run at BaseLayer, play Attack on ArmLayer(masked), what really happen here is, the whole rig (all SpriteRenderers) is playing Attack animation:

    BaseLayer.Play(Run) & ArmLayer.Play(Attack):

    - Root(Transform: Run)
    ---- Body(Transform: Run | SpriteRenderer: Attack)
    ---- Arm(Transform: Attack | SpriteRenderer: Attack)
    ---- Weapon(Transform: Run | SpriteRenderer: Attack)

    what i really want is, SpriteRenderers can be affected by its owner gameobject/transform:

    - Root(Transform: Run)
    ---- Body(Transform: Run | SpriteRenderer: Run)
    ---- Arm(Transform: Attack | SpriteRenderer: Attack)
    ---- Weapon(Transform: Run | SpriteRenderer: Run)
     
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I'm not sure what could be causing something like that. If you can reproduce it in an isolated project and send it to me using a private message or email it to animancer@kybernetik.com.au, I'll be happy to take a look at it for you.
     
  7. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    it's kinda hard cause we have our own asset import flow, animation clip are generated, after some dig, i guess it could be AnimationLayerMixerPlayable's problem (a quite simple graph), it may not handle ObjectReferenceKeyframe correctly, is there any way bypass this issue? (maybe make my own SpriteLayerMixerPlayable ? but how?)
     
  8. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    In theory, you could replace Animancer's AnimationLayerMixerPlayable with an AnimationScriptPlayable to run a custom Animation Job that mixes things however you like. But in practice, I tried it recently and it caused Unity to crash so I just gave up because it wasn't a high priority feature and debugging crashes is a massive pain without even a proper stack trace. I'd be interested to hear how it goes if you try it.

    Another possibility might be to just split your Transform animations out from the Sprite animations so you can play Transform animations on one layer with blending and Sprite animations on another layer without any blending.
     
  9. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    oh.. sounds sad, unity...

    actually in my case i don't need transform blending, but i do need transform mask for sprites, split Transform/Sprites seems not fix my problem.

    generate multiple clips and use multiple animator&animancer for each layer is viable but not elegant though...
     
  10. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, I'm implementing an animation system from scratch and it's time to take a look at Animancer once again.
    Previously, I was working with an exiting Mechanim character controller that cannot be mixed with Animancer.

    Do you remember about Animation Injection I asked while ago? And you positively responded that you will try to find time to properly implement it.

    Timing-wise, it's perfect, now that you are working on 5.0 feature list.

    I really hope it makes it into 5.0 features. Animation injection can simplify working with many different types of animation sets.

    Cheers!

    ps. here is the code sniffets what Animation Injection is about.

    Code (CSharp):
    1.  
    2.  
    3.   private Dictionary<string, AnimationClip> defaultAnimSet = new Dictionary<string, AnimationClip>();
    4.   private Dictionary<string, AnimationClip> rifleAnimSet = new Dictionary<string, AnimationClip>();
    5.  
    6. // first create default AnimSets
    7.   public void InitAnimSet()
    8.   {
    9.     defaultAnimSet.Add("idle", IdleAnimClip);
    10.     defaultAnimSet.Add("walk", IdleAnimClip);
    11.     defaultAnimSet.Add("run", IdleAnimClip);
    12.     ...
    13.     animancer.SetAnimSet(defaultAnimSet);
    14.   }
    15.  
    16. // create custom AnimSets
    17.   public void CreateRifleAnimSet()
    18.   {
    19.     rifleAnimSet.Add("idle", RifleIdleAnimClip);
    20.     rifleAnimSet.Add("walk", RifleIdleAnimClip);
    21.     ...
    22.   }
    23.  
    24. // replace the existing animation using the new AnimSet.
    25. // when previous animation is found, unload it.
    26.   public void InjectAnimSet(Dictionary<string, AnimationClip> rifleAnimSet)
    27.   {
    28.     animancer.SetAnimSet(rifleAnimSet);
    29.   }
    30.  
    31.   void Update()
    32.   {
    33. // Find the animation from the current AnimSet and play.
    34.     animancer.Play("idle");
    35.   }  
     
  11. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Is something like this what you had in mind for animancer.SetAnimSet?
    Code (CSharp):
    1. // In AnimancerPlayable.StateDictionary.
    2. // Call using animancer.States.SetAnimations(...).
    3. public void SetAnimations(Dictionary<object, AnimationClip> animations)
    4. {
    5.     foreach (var animation in animations)
    6.     {
    7.         if (TryGet(animation.Key, out var state))
    8.         {
    9.             state.Clip = animation.Value;
    10.         }
    11.         else
    12.         {
    13.             Create(animation.Key, animation.Value);
    14.         }
    15.     }
    16. }
    Note that I used object as the key since there's no need to limit it to only strings.
     
  12. Deleted User

    Deleted User

    Guest

    Having the following simple FSM setup; i can't get it to work properly. I only see 'Entering IdleState' and then nothing.
    I also see that the IdleState (or FallingState) components are never enabled.

    What obvious (stupid) thing am i missing here ?

    Thank for your help !

    https://imgur.com/02TKwzZ
     

    Attached Files:

  13. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    @onefoxstudio Uploading the project to github would make it much easier for others to look at your code and assist you. Anyone would be able to download the complete project in the same state that you are using it and give you feedback much more easily.
     
    Deleted User likes this.
  14. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    @onefoxstudio You are overriding a method that is used by Animancer to control the states, specifically StateBehaviour<TState> which is being inherrited by PlayerState.
    *edit*You either should not override the OnEnterState or OnExitState methods within any of your states or, as Kybernetic suggests below, add a call to the base method.

    For you FallingState, replace with the following.
    Code (CSharp):
    1. //public override void OnEnterState()
    2. //{
    3. //    Debug.Log("Entering FallingState");
    4. //    Player.Animancer.Play(Animation);
    5. //    targetFallHeight = -Mathf.Infinity;
    6. //}
    7. private void OnEnable()
    8. {
    9.     Debug.Log("OnEnable FallingState");
    10.     Player.Animancer.Play(Animation);
    11.     targetFallHeight = -Mathf.Infinity;
    12. }
    13.  
    and your IdleState replace with the following
    Code (CSharp):
    1. //public override void OnEnterState()
    2. //{
    3. //    Debug.Log("OnEnterState IdleState");
    4. //}
    5. private void OnEnable()
    6. {
    7.     Debug.Log("OnEnable IdleState");
    8.     Player.Animancer.Play(_MainAnimation);
    9. }
    Animancer uses the OnEnterState & OnExitState for it's own purposes, when you override it, Animancer is prevented from operating the StateMachine. Please use the OnEnable & OnDisable functions for the Entry & Exit points of a state.

    There is more information about this in the documentation under the topic of State Behaviours, which can be found at https://kybernetik.com.au/animancer/docs/manual/fsm.

    While this will correct the issue that the state machine is not updating, you will may find that your states aren't flowing correctly.
     
    Last edited: Jun 15, 2020
    Deleted User likes this.
  15. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    @onefoxstudio I believe @craigjwhitmore is correct about your issue. Also, it's fine to override OnEnterState as long as you still call base.OnEnterState() inside it.
     
  16. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    One of the reasons for using AnimSet Injection is that it needs to unload previous AnimSet if it's replaced by the new AnimSet so that you can save memories.
     
  17. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    How about something like this then:
    Code (CSharp):
    1. public void SetAnimations(
    2.     ref Dictionary<object, AnimationClip> currentAnimations,
    3.     Dictionary<object, AnimationClip> newAnimations)
    4. {
    5.     foreach (var animation in newAnimations)
    6.     {
    7.         if (TryGet(animation.Key, out var state))
    8.         {
    9.             state.Clip = animation.Value;
    10.         }
    11.         else
    12.         {
    13.             Create(animation.Key, animation.Value);
    14.         }
    15.     }
    16.  
    17.     if (currentAnimations != null)
    18.     {
    19.         foreach (var key in currentAnimations.Keys)
    20.         {
    21.             if (!newAnimations.ContainsKey(key) &&
    22.                 TryGet(key, out var state))
    23.             {
    24.                 state.Destroy();
    25.             }
    26.         }
    27.     }
    28.  
    29.     currentAnimations = newAnimations;
    30. }
    31.  
     
  18. Deleted User

    Deleted User

    Guest

    Thank you @Kybernetik @craigjwhitmore i think after reading a lot of examples i got confused; all good an clear now. Thank you very much !
     
  19. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I see. I can manually create and destroy them. I thought there was something more special stuff involved when you said you need to think about ways to implement it properly.

    Anyway, it would be nice to be able to make AnimSet into 5.0 API so that everyone can benefit.
    API, in my opinion, is just a convenient set of functions so that users don't have to reinvent them.
    Cheers!
     
  20. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    That's why I originally had trouble figuring out what you actually wanted, because a simple method like that to just create and destroy some states could even be implemented as an extension method without needing any internal modifications to Animancer.

    Adding that method to v5.0 would be reasonable, but it's usefulness seems a bit limited to me because it wouldn't work for transitions or anything else and I really don't want to promote the use of magic strings. I was thinking you wanted something more along the lines of what I suggested here, but the only part of that which could be standardised is the GetAnimation method which is only half a dozen lines.

    Also, if you're using Generic Rigs in Unity 2019+, I might have good news regarding your earlier question about mixing Animancer with an Animator Controller assigned to the regular Controller field on the Animator component. I'm still trying to work out some kinks, but it looks promising.
     
    Last edited: Jun 15, 2020
  21. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I'm working on a shooter game where you are holding a weapon that requires different AnimSet for each weapon types. This is where the AnimSet Injection can come in handy.

    Regarding mixing Mechanim and Animancer, the character controller is based on Humanoid and I'm not sure if it can support Generic.

    Thanks.
     
  22. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    BTW, I have a simple question.
    Is there a way you can change "wrapMode" for the AnimationClip?
    The following code doesn't seem to have an effect.

    Code (CSharp):
    1. animClip.wrapMode = WrapMode.Loop; // changing from WrapMode.Once
    2. AnimancerComponent.Play(animClip);
    3.  
    Thanks.
     
  23. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    WrapModes are only used by the Legacy animation system. Playables only use the isLooping property which is read-only. The AnimancerEditorUtilities class has a method that can be used to set it in the editor, but it's a bit of a hack and last I checked you actually had to close and restart Unity for the change to properly take effect.
     
  24. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Hey everyone, Animancer v5.0 Alpha 1 is now available for testing. You can download Animancer Lite from the documentation, or if you have Animancer Pro you can email the Invoice Number from your Asset Store purchase to animancer@kybernetik.com.au.

    Major Features:
    • Animancer can now be blended with an Animator Controller assigned to the regular Controller field on the Animator component, though this is subject to several limitations which are explained in the Change Log.
    • Expanded support for Animation Jobs.
    • Added Custom Fade system for easily fading weights using an AnimationCurve, custom delegate, or Interpolation.Function enum to tweak your transitions as described here.
    • Several significant bug fixes and improvements to internal systems.
    See the Change Log for the full list of features and changes.

    I'll be posting about individual test releases over in my Work In Progress thread rather than spamming this one.
     
    hopeful and petey like this.
  25. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hey V5 looks awesome!
    Hey, just wondering is there a way to get an event for when Animancer.Play() is called? I just have a script that I'd sometimes like to run just before playing certain animations.
    Thanks!
     
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The closest thing is the AnimancerLayer.CommandCount which is just an int that gets incremented every time something is played so other systems can check if that has happened since they started. For example, the CustomFade system in v5.0 uses it to automatically stop itself if something else is played while the custom fade was in progress.

    One approach for an actual event before the new state is played would probably be to just inherit from AnimancerComponent, copy over all the Play methods, give them the new keyword, and have them trigger your event before calling the corresponding base.Play method. Or maybe you could make the property you use to access the AnimancerComponent trigger your event.
     
  27. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hey thanks,
    Is this what you were thinking, but with all Play methods? I'm having a little trouble getting it to work...
    Code (CSharp):
    1.  
    2. public class Ch_Anim : AnimancerComponent
    3. {
    4.     public new AnimancerState Play(AnimationClip clip)
    5.     {
    6.         Debug.Log("Do the thing!");
    7.         return base.Play(States.GetOrCreate(clip));
    8.     }
    9. }
     
  28. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Yeah, that's the idea, but you will also need to replace all the AnimancerComponent references in your code with Ch_Anim because you aren't overriding virtual methods so calls to AnimancerComponent.Play won't know that you want them to check if the AnimancerComponent is actually a Ch_Anim to call your method.
     
  29. launzone

    launzone

    Joined:
    Dec 2, 2015
    Posts:
    57
    Hey! I wanted to ask if there are any Updates for accessing OnAnimatorIK for different layers than 0. After working with Animancer for quite some time now I just ran into this problem.
    https://kybernetik.com.au/animancer/docs/manual/ik/ Here it says that the IK pass only works for layerindex 0. There is no workaround for this right? My problem is that I need to adjust IK positions after an additive animation layer. Just wanted to know if the Animancer dev or anyone in the community has experience with something like that.
     
  30. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Check out the Animation Rigging package. It has a much more flexible IK system which applies after the entire Animancer graph (or Animator Controller) has been evaluated so I think it might work like you need, though I've never actually used it myself.
     
    launzone likes this.
  31. launzone

    launzone

    Joined:
    Dec 2, 2015
    Posts:
    57
    thank you! so you are suggesting that i can use it in addition to animancer?
     
  32. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Yes, I haven't actually used it for anything but I did check to make sure it works.
     
  33. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hey thanks for the help!
    I'm really looking forward to checking out V5, I was just wondering, is it possible in V5 to have an ease curve control the blend of a Mixer? So instead of a linear mix you could have something a little softer?
     
  34. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Mixers don't change their parameter over time or anything, so couldn't you just do mixer.Parameter = curve.Evaluate(...)?

    v5.0 does have an Interpolation class with all the common easing functions in it so you can use that if you don't already have one. Also, I just released Animancer v5.0 Beta 1 which fixes some inconsistencies between the functions in that class so you should get the new one if you already downloaded the Alpha.
     
  35. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Oh haha yes that works fine thank you. I've lost it :rolleyes:
    I haven't jumped onto the beta yet, I was a little worried about breaking things. I'm in the process of moving everything over from Animator Controllers so maybe I should just do it.
     
  36. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I would recommend that everyone use the Beta since it fixes all the bugs I know about from earlier versions (all the ones I can actually fix at least). It should be very stable because I now have over 3x as many unit tests as I did when releasing v4.4.
     
  37. closingiris

    closingiris

    Joined:
    May 18, 2019
    Posts:
    7
    Hello @Kybernetik, first let me say I really like how you've structured Animancer and think what you've done is great. I've purchased a Pro license and have started using it in my work. Recently, I've wanted to prototype a spherical gravity system and want to use the 3D Game Kit assets. Your 3D game kit example is really nice to be able to drop into my 'flat' gravity prototypes, and fixes so many issues with the one that Unity released. In fact it was a big selling point for me when I was deciding to purchase your asset.

    Anyhow, long story short, I've run into an issue with the RootMotion in spherical gravity.

    When I use base 3DGK I am able to get the root motion to apply properly in any orientation, however when I use the Animancer version I notice that the root motion only applies properly if I am on the standard XY plane.

    The following line from `Creature.cs` is the culprit.

    Code (CSharp):
    1. var motion = StateMachine.CurrentState.RootMotion
    After some investigation it appears as if the resulting `motion` Vector3 is always set as if I was on the standard XY plane. Any thoughts?
     
  38. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I've never worked with custom gravity before, but something like
    motion = rotationDueToGravity * motion;
    (and the same for the direction retrieved from _Brain.Movement) might be all you need.
     
  39. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    Hey, is there a way to set an animation to loop at run time? Or when we tell it to play?

    Reason being:
    Unity has a bug where whenever you replace an FBX file in the project where the animation data inside of it won't update when it imports the new file. I.E. If File A has an idle animation and we replace it with File B that has a walk animation added to it and open the FBX, the new animation isn't there. And the old animation won't update if you changed the length of it.

    Only way I've seen to fix that so far is to remove all the current clips in the FBX inspector, uncheck the "import animation" box, save, recheck it, save (repeat a bunch sometimes) and eventually it will load with all the correct clips and lengths. It's super obnoxious.

    The big problem with this is that I lose all the settings I placed on the animation clips such as LOOP. So every time I wanna re-import my animations, I have to manually go in and tell all the looping animaitons to "Loop Time" again.

    Apparently this bug has been around since 2013 or some such. If you know a way around that problem altogether that'd be great! Otherwise being able to set the loop properly through script would be excellent.

    I tried having the animation play again when the OnEnd event happens and also setting the time for that event to be 1 frame before the animation actually ends but the character still stops moving for one frame every time the loop happens.
     
  40. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Unfortunately not, and the only way I've actually found to set it with an Editor script doesn't even work properly. It looks like it works in the Inspector and checking the clip with a script says it worked, but when you actually play the animation the change doesn't actually take effect until you close and restart Unity.
     
    frostymm likes this.
  41. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    Darn, thanks for the quick response. I guess a good alternative might be batching the animations out to multiple FBX files so I don't have to fix so many at any given time. That might get complicated too though....

    Either way, thanks a bunch, keep up the good work!
     
  42. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hey @frostymm that sounds like a painful bug. Have you tried exporting clips using the @clip naming method. I way prefer it. It’s nice because you don’t have to write out a big file with everything in it so exports are way quicker.
     
  43. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    You mean export each animation as its own FBX file? Wouldn't that duplicate my model information a bunch of times? Is there any benefit to doing that over just pulling the animations out of the one FBX file directly with Ctrl+D?
     
  44. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    You don’t have to include any mesh data in the animation files so they can be pretty light.
    Check the end of this link.
    https://docs.unity3d.com/Manual/Splittinganimations.html
    I found managing all animations in one file a bit annoying and prefer doing most of that work in my 3d app. It’s just another approach.
     
    frostymm likes this.
  45. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    135
    Do you have any suggestions on how I can implement a sub-state machine for Animancer?

    I'm not particularly sure how I should set a sub state. For example, lets say I have an ActionState within the core state machine, if I want to then call a particular action within the sub state, how should I set the base state and forward the required state for the sub-state machine to enter.
     
  46. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    There's nothing stopping you from giving the ActionState something like a StateMachine<SubActionState>.

    As for how to control it, the general approaches to Communication described in the Brains example still apply. You could give your Brain or Creature a property to indicate which sub-state you want to be in so that if you are currently in the ActionState it can check that value. Or you could give your Brain or Creature a direct reference to the ActionState (like how the Platformer example has a reference to its Attack state in its Brain) so that you can directly access its state machine.
     
    craigjwhitmore likes this.
  47. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    Hi, I'm getting this warning when setting AnimancerComponent.Layers at runtime:

    "Creating an AnimancerPlayable during a repaint event is likely undesirable."

    Am I doing something that Animancer doesn't like, and is it going to cause any issues?
     
  48. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The warning itself is harmless, it just suggests that you might be doing something a bit odd during a GUI Repaint event. Typically that would only happen in a custom Inspector or editor window so I'm not sure what would be causing it at runtime.

    Can you give a bit more context? What does the full stack trace look like?

    Also, which Animancer version are you using?
     
  49. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Hi, i have the same issue as https://forum.unity.com/threads/ani...e-animator-control.566452/page-9#post-5912540
    Is there a reason why the fade duration does not work as expected for the LinearMixerState transition?
    (It uses fade duration for the other transitions (direct clips), but for the mixer it seems to be ignored)


    If i manually plug it into the play method as second parameter (Play(mixerState, mixerStateTransition.FadeDuration)) it works
     
    Last edited: Jul 2, 2020
  50. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    States do not have a fade duration, only transitions do. So if you want it to use the fade duration defined in the transition, you need to Play(mixerTiansition), not Play(mixerState).