Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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,592
    If Spine generates Animation Clips that you would normally play in an Animator Controller, then yes Animancer will be able to play them.
     
  2. Frankie3

    Frankie3

    Joined:
    Jan 29, 2014
    Posts:
    13
    Is it possible to use Animancer to animate images on the UI? I tried playing around with it and could not get it to work. I saw this page about types and it does not seem like UI stuff is supported since it looks for a sprite renderer.
     
  3. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    354
    Is there any third party character controller on the asset store or upm that actually uses this asset?
     
  4. eudendeew

    eudendeew

    Joined:
    Feb 5, 2017
    Posts:
    18
    Hi, how can I swap layers? And also how to remove them?

    I want to send a layer (that has already been played) to the bottom (so it overrides existing layers) and play it again.

    Currently this seems to work, but I want to know if I'm not breaking something:

    Code (CSharp):
    1. /* Some IF to know if _animationToLayerPairs contains a layer*/
    2. {
    3.     AnimancerLayer layer = _animationToLayerPairs[myKey];
    4.     layer.DestroyStates();
    5.     layer.DestroyPlayable();
    6. }
    7.  
    8. AnimancerLayer newLayer = _animancer.Layers.Add();
    9. _animationToLayerPairs[myKey] = newLayer;
    10. return newLayer;
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    @Frankie3 Animancer itself doesn't look for a SpriteRenderer, that's handled by the underlying animation system if the animation tells it that's what it wants to animate. If you want to animate a UI Image component instead, then it should work exactly the same as if you were using an Animator Controller.

    @Slashbot64 I'm not aware of any. It's definitely on my list of things I'd like to work on, but it's a very long list and at the moment I'm focussed on Animancer v8.0.

    @eudendeew Layers aren't designed to be moved so destroying and creating a new one like that would be a hacky workaround. Can you explain what you're doing in more detail? It sounds like very unusual use case, but I could potentially add support for rearranging layers.

    Also, for your comment at the top, you can do this:
    Code (CSharp):
    1. if (_animationToLayerPairs.TryGetValue(myKey, out var layer))
    2. {
    3.     layer.DestroyStates();
    4.     layer.DestroyPlayable();
    5. }
    Also, consider that while layers can't currently be moved, states can be moved to a different layer instead of destroying and recreating them.
     
    eudendeew likes this.
  6. Darhkuan

    Darhkuan

    Joined:
    Feb 24, 2014
    Posts:
    24
    Hi quick question, just upgraded to pro from lite, do I just import the entire of the pro asset and it will automatically overwrite any parts of the lite asset?
    This is an amazing tool, so much simpler than the inbuilt unity spaghetti monster
     
  7. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    Yes, you can just import Pro over the top of Lite.
     
    Darhkuan likes this.
  8. eudendeew

    eudendeew

    Joined:
    Feb 5, 2017
    Posts:
    18
    Specific case indeed :p , it happens that artists had let's say bay-door-open and bay-door-close among the several animations, animations are referenced at runtime (assets created on another project, then loaded as bundles), so I placed each animation in layers so all animations can simultaneously modify it, but Open and Close affect the same bones so playing both would later stop replaying the other, so deleting the layer and placing it at the bottom does work, and also free ups memory and the inspector view. We recently changed to Animancer and we didn't have a way to tell that an animation should be in the same layer, it will be done someday but that will require reexporting 100s of bundles.

    Thanks for the quick reply, I've been changing every project to use Animancer :D
     
  9. Darhkuan

    Darhkuan

    Joined:
    Feb 24, 2014
    Posts:
    24
    @Kybernetik cheers, I did the import, however now I have this error coming up - is this an old version or is meant to be using imageconversion now?

    Assets\Plugins\Animancer\Internal\Editor\Animancer Tools\PackTexturesTool.cs(169,43): error CS1061: 'Texture2D' does not contain a definition for 'EncodeToPNG' and no accessible extension method 'EncodeToPNG' accepting a first argument of type 'Texture2D' could be found (are you missing a using directive or an assembly reference?)
     
  10. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    Have you disabled the Built-in Image Conversion module in your project? It should be enabled by default.

    upload_2023-11-25_20-6-2.png

    If you don't plan on using the Pack Textures Tool, you could just comment out the contents of the method the error is coming from.
     
    Darhkuan likes this.
  11. Darhkuan

    Darhkuan

    Joined:
    Feb 24, 2014
    Posts:
    24
    Ah I don't know why I didn't check to see if it was enabled. Had made the assumption it was!!! I'd just commented it out for the time being, it is all working now, thanks!
    Also the documentation you have for Animancer is just great, the way it's structured is brilliant!
     
  12. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,558
    Oh, no. I wish you wouldn't do that. I think of Assets/ as stuff that goes in the game, and Packages/ as extensions to Unity's editing environment or interfaceless engine-level code. Having InspectorGadgets in Packages/ makes sense. If I need a
    using Animancer;
    in my own scripts, it's part of the codebase I want in Assets/.
     
  13. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    That's an interesting way of looking at things, though I disagree. I see Packages as self-contained generalised systems intended for use in any project while Assets is for stuff specific to the current project. The need for using statements certainly wouldn't be a good indicator since even Inspector Gadgets has scripting interactions for things like the Decorator Attributes.

    Regardless, the fact that making it a Package has actual tangible benefits (the ability for other Packages to actually reference it and to set up a conditional compilation symbol when Animancer is present) is worth much more than anyone's personal preference on where to put things.
     
    Last edited: Jan 21, 2024
    TeagansDad, daxiongmao and desukarhu like this.
  14. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    413
    Just got Animancer and having trouble with parameters. Specially on how to get them for nested mixers. Somehow I haven't been finding any info/examples on nested ones. I saw something that would be nice marked for the next version.

    I build my mixer setup using the ScriptableObjects. They reference each other and then I attach them to a
    MixerTransition2D on my controller class. I have a direct reference to the top MixerTransition2D so i could change its parameters. But the nested walk / run mixers etc how do i reference them?
    I assuming since they are scriptable objects I can't just make reference to each one individually since i am assuming they are instantiated?. Or is that what I am missing?

    Seems if i had each referenced separately I could construct the mixers in code but seems unnecessary.
    Thanks
     
  15. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    The Nesting section has examples of the two current approaches.
     
  16. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    413
    Thanks I saw the picture there, but I guess i didn't expand the code. But they seem to describe the two cases I was thinking of.

    upload_2023-12-8_0-25-17.png

    This is what I did just before I saw your reply.
    Is there a better way to pass the same value to multiple mixers?
    upload_2023-12-8_0-28-51.png
    The ones here are 4 directions whit their linear parameter blending between walk and run.
    They all have different clips though.
    While movement state blends between the directions.
     
  17. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    There is no way to set multiple parameters at once without the new binding system so you need to do it like that for now.
     
  18. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    413
    Thank you. I saw the github for the new version. Look forward to that one.
    I may look at adding a name to them and setting it in the key possibly.
    Then at least through the inspector you could assign the name or key and use that to reference them when finding vs debug name or index.
     
  19. Njordy

    Njordy

    Joined:
    Mar 31, 2019
    Posts:
    24
    Hi. A bit of warning messages in import/opening up the project:

    Assets\Plugins\Animancer\Internal\Editor\Attributes\SelfDrawerAttribute.cs(57,30): warning CS0672: Member 'SelfDrawerDrawer.CanCacheInspectorGUI(SerializedProperty)' overrides obsolete member 'PropertyDrawer.CanCacheInspectorGUI(SerializedProperty)'. Add the Obsolete attribute to 'SelfDrawerDrawer.CanCacheInspectorGUI(SerializedProperty)'.

    Assets\Plugins\Animancer\Internal\Editor\GUI\TransitionDrawer.cs(68,30): warning CS0672: Member 'TransitionDrawer.CanCacheInspectorGUI(SerializedProperty)' overrides obsolete member 'PropertyDrawer.CanCacheInspectorGUI(SerializedProperty)'. Add the Obsolete attribute to 'TransitionDrawer.CanCacheInspectorGUI(SerializedProperty)'.

    Assets\Plugins\Animancer\Internal\Editor\GUI\SerializableEventSequenceDrawer.cs(48,30): warning CS0672: Member 'SerializableEventSequenceDrawer.CanCacheInspectorGUI(SerializedProperty)' overrides obsolete member 'PropertyDrawer.CanCacheInspectorGUI(SerializedProperty)'. Add the Obsolete attribute to 'SerializableEventSequenceDrawer.CanCacheInspectorGUI(SerializedProperty)'.

    Nothing serious, right? 2023.2.3
    // about to start learning your asset :)
     
  20. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    I don't have that Unity version installed but they look harmless and the documentation doesn't suggest any alternative so I guess it's just a feature they removed.

    You can get rid of the warnings by putting [System.Obsolete] above each of those methods.

    To make sure nothing is broken, take a look at the Transitions Example. If the event timeline below the End Time in each of the transitions shows up correctly then everything should be fine.
     
    Njordy likes this.
  21. liuchunyao90

    liuchunyao90

    Joined:
    Mar 31, 2022
    Posts:
    7
    When I packed some Sprites into one picture, it shows:
    NullReferenceException: Object reference not set to an instance of an object
    Animancer.Editor.Tools.SpriteDataEditor.SetName (System.Int32 index, System.String name) (at Assets/Plugins/Animancer/Internal/Editor/Animancer Tools/SpriteDataEditor.cs:58)
    Seems like the provider load the sprites failed, the unity version is 2021.3.32 and macOS is 12.7.1. Thanks for any help
     
  22. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    I can't see any reason for that to happen. Would you mind sending your un-packed sprites and their metadata files to animancer@kybernetik.com.au so I can try to replicate the issue?
     
  23. liuchunyao90

    liuchunyao90

    Joined:
    Mar 31, 2022
    Posts:
    7
    OK , I had sent the email.
     
  24. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    Replacing the SpriteCount property in SpriteDataEditor.cs with this should fix the issue (there's two SpriteCount properties, just replace the first one):
    Code (CSharp):
    1.         public int SpriteCount
    2.         {
    3.             get => _SpriteRects.Length;
    4.             set
    5.             {
    6.                 Array.Resize(ref _SpriteRects, value);
    7.  
    8.                 for (int i = 0; i < _SpriteRects.Length; i++)
    9.                     _SpriteRects[i] = new();
    10.             }
    11.         }
     
  25. liuchunyao90

    liuchunyao90

    Joined:
    Mar 31, 2022
    Posts:
    7
    Thank you so much! The response was so fast.
     
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    That's very strange, it's packing them correctly for me with that fix. Are there any other different warnings above those ones? And have you modified the input textures at all since the ones you sent me?

    upload_2023-12-10_16-7-58.png
     
  27. liuchunyao90

    liuchunyao90

    Joined:
    Mar 31, 2022
    Posts:
    7
    Sorry. It's my fault, I had modified the code for debugging. Sorry for waste your time.
     
  28. firozjokhi

    firozjokhi

    Joined:
    Nov 11, 2020
    Posts:
    19
    Hi, I am using Animancer.Play(Transition) to play animations for walking, shooting, rolling etc.

    I got animations working, but using script, how do I ensure the Rolling animation always goes from start to end without being interrupted by other animations?

    Would I have to use States to handle this?
     
  29. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
  30. firozjokhi

    firozjokhi

    Joined:
    Nov 11, 2020
    Posts:
    19
    Yes, but I am asking if I can control if an animation can be interrupted vs forced to play all the way through without using a State system.
     
  31. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    311
    There is a quick way to do this. by playing the unterruptable animation in it's own layer that is on top of everything else.
    But honestly you should look into state machine for this problem.
     
  32. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    State machines are often a good way of managing that sort of thing, but you can use whatever sort of system you want to control Animancer. It will always do what you tell it to so if you don't want stuff to interrupt other stuff then it's up to your scripts to enforce those rules.
     
  33. solsnare

    solsnare

    Joined:
    Dec 7, 2016
    Posts:
    23
    Hey!

    Your plugin is really awesome so far, just looking through documentation and trying out Lite in order to see if it's worth some of the complications it'll create for me on the networking side using Mirror (currently it handles syncing AnimatorControllers) automatically.

    My main issue at the moment when trying the Lite version off the asset store:

    It appears there's no default way to scrub through ClipTransitions while seeing a preview of that animation play directly in the editor? (As per docs)

    When you assign a clip transition, you get this nice inspector which lets you double click to add new events and also set transition lengths.. that is fantastic as it really saves you from having to go into the anim clip window, and lets you add events per clip.
    upload_2024-1-6_12-22-27.png

    However, without being able to immediate scrub through this state and see it change in the editor, finding out where in that animation something occurs is a tedious process or requires the editor to be playing (has it's own issues, adding an event and then going back to editor erases it.. which means having to copy n paste the component back in.. just really janky and can be solved by making an easy way to scrub through in edit mode).

    I guess one other quirk that I'm not entirely sure how to handle is assigning events to clips within blendtree/mixers? (also same issue with above.. I'd like to preview this in editor like AnimatorController does?)

    upload_2024-1-6_12-42-22.png

    I know that the animation events in the clip still work.. which is a workaround that can be used, but I'd rather it be available here just like the rest? I want to respond to when the legs touch down to the ground n play particles/sound?

    I can imagine some workarounds like using scriptableobjects for animations, keeping the cliptransition in there, and then manually creating this blendtree n playing cliptransitions instead of clips? But it would require a fair bit of boilerplate and fenangling to get that working.

    Would love your thoughts @Kybernetic

    EDIT:
    I did get the first one functioning doing the onvalidate method n pulling the clip ref directly out of the transition.. At least I can do this in the editor with a custom slider now.

    Code (CSharp):
    1.  
    2. [Range(0.0f, 1.0f)]
    3. public float Time = 0;
    4. public int frame = -1;
    5. public float frameTime = 0;
    6. private void OnValidate()
    7. {
    8.     var clip = attackClips[currentState].Clip;
    9.     // Apply the first frame of the animation.
    10.     clip.EditModeSampleAnimation(_controller);
    11.  
    12.     // Apply the effects of the frame 0.5 seconds into the animation.
    13.     float finalTime = 0.0f;
    14.  
    15.     if(frame >= 0)
    16.     {
    17.         finalTime = frame * (1.0f/clip.frameRate);
    18.         frameTime = finalTime;
    19.     }
    20.     else
    21.     {
    22.         finalTime = clip.length * Time;
    23.     }
    24.     clip.EditModeSampleAnimation(_controller, finalTime);
    25.  
    26.     // Actually play the animation.
    27.     //attackClips[currentState].Clip.EditModePlay(_controller);
    28. }

    That being said, this would be great to be present by default, and allow me to set the event at the point that I scrubbed with a single click.
     
    Last edited: Jan 6, 2024
  34. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    The button in the top right of every Transition opens the Transition Preview Window.

    If you want to set up events in the Inspector for individual children of a Mixer, you need to use Transition Assets. Make a ClipTransitionAsset for the child so you can set up its events in that asset, then give it to the Mixer instead of giving it the AnimationClip directly. Note that events from all children will trigger as the Mixer plays so you might want to check the AnimancerEvent.CurrentState.Weight during an event to decide if you actually want to respond to it.
     
    solsnare likes this.
  35. solsnare

    solsnare

    Joined:
    Dec 7, 2016
    Posts:
    23

    Ahhhh perfect! Thanks so much for the quick response. That makes things a lot easier.
    (Though it doesn't seem to fire the events? Anyway to toggle that to make it function? I'd like to see the particles going off)

    My last concern is you know if it'll be hard to integrate Animancer into a networking package like Mirror.

    I would imagine the approach is to somehow intercept any and all events that get called into AnimancerController, probably by inheriting from it and extending any of the functions so that you can react to Play, Stop and Speed variables among others.

    I could use a [SyncVar] with the ElapsedTime to make sure that the play head is at the right time.. but yeah, this is the part that I'd say is the most weird to sync up?

    I can't seem to find any information on doing this, which is strange, since it seems to be such a popular animation plugin.

    Any ideas / resources? Mirror is based off UNet which makes it fairly compatible with a lot of unity stuff.
     
  36. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    That's intentional and Unity's animation previews do the same because your events could be doing anything and could very easily affect other things in the scene or simply throw a ton of errors for things not being initialized fully in Edit Mode.

    If you want to try it, you could go to TransitionPreviewWindow.Animations.cs and comment out the if block at the end of the OnPlayAnimation method where it clears the events.
    Unfortunately, networking is probably Animancer's biggest weakness
    • The Disadvantages section in the State Machines overview explains my very limited understanding of networking and the challenges caused by the Animancer allowing you to play animations from anywhere without a centralised location like an Animator Controller where everything is defined upfront. The Transition Set system I want to implement for Animancer v8.0 would likely help with that particular issue, but it's still a long way off.
    • The Photon Fusion Technical Samples include one that uses Animancer.
    • This Thread has a few other people with experience networking Animancer.
     
    hopeful likes this.
  37. OliverTheLove

    OliverTheLove

    Joined:
    Jun 26, 2016
    Posts:
    24
    Hello!
    Recently started converting my project to use Animancer and its feeling pretty solid! I have a question regarding changing a ClipTransition in runtime. I have a state machine setup, and I want to be able to set AnimationClips on each spell in my game. I have an instant ability state and a casting state, where I want to be able to swap the animations, but I am not quite sure what they best practice is to achieve my result.

    This is what I have done so far for the instant ability state. It seems to work, but I am not sure if there are better solutions. I have to copy the transitions data and re apply the OnEnd delegate, as I would else put the OnEnd delegate directly on the input parameter (as I am referencing it).


    Code (CSharp):
    1. public class BbAnimStateAbility : BbAnimationState
    2. {
    3.     [SerializeField] private ClipTransition myAnimation;
    4.  
    5.     public override bool CanInterruptSelf => true;
    6.  
    7.     protected override void Awake()
    8.     {
    9.         base.Awake();
    10.         myAnimation.Events.OnEnd = OnAnimationEnded;
    11.     }
    12.  
    13.     private void OnEnable()
    14.     {
    15.         myLayer.Play(myAnimation);
    16.     }
    17.  
    18.     private void OnAnimationEnded()
    19.     {
    20.         myAnimator.ForceSetDefaultState(myIsLowerBody);
    21.     }
    22.  
    23.     public override void SetAnimationClip(ClipTransition aClipTransition)
    24.     {
    25.         myAnimation.CopyFrom(aClipTransition);
    26.         myAnimation.Events.OnEnd = OnAnimationEnded;
    27.     }
    28. }
     
  38. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    If the ClipTransition you're copying from is owned by that character and not shared with other instances then you could probably just assign it directly instead of copying its contents. But otherwise that looks like a fine way of doing it.
     
  39. OliverTheLove

    OliverTheLove

    Joined:
    Jun 26, 2016
    Posts:
    24
    Alright, thanks for the reply :)
     
  40. nns2009

    nns2009

    Joined:
    Dec 14, 2018
    Posts:
    1
    I have what seems like a trivial question: is it possible to loop animations?
    Google couldn't find anything and the page:
    https://kybernetik.com.au/animancer/docs/manual/playing/
    doesn't contain a single word "loop".

    Animancer state has "IsLooping", but it's readonly.

    I eventually found an import option to make animations imported from Blender loop at import time, but I couldn't find any way to control looping with Animancer
     
  41. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
    Unity doesn't allow the looping property to be changed at runtime so the import setting is the correct way of doing it.

    If you really don't want to use the import setting for some reason, the Event Utilities Example shows how you can fake it with an event.
     
  42. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    674
    Hi @Kybernetic,

    I'm looking to replace a complex Mechanim character controller with a pure-Animancer solution. Existing marketplace solutions use Mechanim. Do you know of a full featured character controller solution which uses Animancer exclusively? The character controller example provided with Animancer is a good introduction but it leaves a lot to be desired. I would use the HybridAnimancerComponent, but because it does not allow adjustment of speed, which complicates things like walk/run sequences.
     
  43. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
  44. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    674
    Hi Kybernetik --

    Thank you for your reply. If you find yourself able, I believe Animancer Pro would be greatly improved by having a reference implementation of this character controller solution: https://assetstore.unity.com/packag...-updates-in-new-charactercontroller-pa-196526 Unity's default character controller provides a good balance of features and complexity, and I believe Animancer Pro would benefit from supporting it.
     
  45. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    674
    I notice that the size of AnimancerComponent.States increases over time as my characters play different clips. I call

    AnimancerComponent.Events.OnEnd() => ... animancerState.Destroy(), but two things happen:

    1) The number of states in AnimancerComponent.States continues to increase, and
    2) I get key collision errors when a state and clip I previously destroyed is replayed.

    What might I be doing wrong?


    Code (CSharp):
    1. HybridAnimancerComponent animancer = _AnimancerAnimators[i];
    2.    AnimancerState animancerState = animancer.Play(clip, fadeDurationS);
    3.  
    4.    // fade animancerState
    5.    float fadePositionNormalized = (clip.length - fadeDurationS) / clip.length;
    6.    animancerState.Events.Add(new AnimancerEvent(fadePositionNormalized, () =>
    7.    {
    8.        if (_IdleClip != null)
    9.            animancer.Play(_IdleClip, fadeDurationS);
    10.        else if (_IdleController != null)
    11.            ResumeController(fadeDurationS);
    12.    }));
    13.  
    14.    // destroy animancerState
    15.    animancerState.Events.OnEnd = () =>
    16.    {
    17.        animancerState.Destroy(); // state still persists!
    18.    };
    ** update. It appears that OnEnd is not firing. My ResumeController logic is as follows:

    Code (csharp):
    1.  
    2. ControllerState controllerState = new ControllerState(_IdleController);
    3. _AnimancerAnimators[i].Play(controllerState, fadeDurationS);
    4.  
    I imagine that should fire the OnEnd event for the prior animation, right?

    ** update. If I transition to the next clip in OnEnd, the event fires. But the problem with destroyed states remains -- they won't go away...

    *** update. Cool -- OK, the issue is that I have a collection of animations and I am starting the next animation for the first element in the collection, which removes subsequent events for succeeding elements. User error and I think I'm good.
     
    Last edited: Jan 22, 2024
  46. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    674
    Perhaps this exists and I'm just a newb. I feel like there needs to be a specific event that tells me when a clip is finished playing that is not cleared when a subsequent clip is played. The primary use case is to release memory from an asset bundle handle. I can't use a normalized time event because the clip isn't finished. I can't use OnEnd because, well, the event won't fire if and when it is interrupted by a subsequent clip.

    This is probably my issue for not understanding Animancer better.
     
  47. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,702
    @Kybernetik
    Hi there, I want to get the NormalizedTime of an animation. I am of the understanding this should always be a value between 0 and 1. If that is not the case, please let me know how to get the value.

    That said, using this code, the value appears to just move upward past 1.


    I am getting the time here.


    I am monitoring the return here, and in the print to cosole this value moves far past 1.



    ??
     
  48. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,592
  49. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    674
    Terrific. Thank you!
     
  50. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,702
    Hi tha
    Hi, thank you!
    But I do not grasp how to apply this. Can you write the few lines of code, needed to get a value between 0-1 regarding the point in poercentage an animation is in its animation?

    Thank you!