update current animation frame on update

I ve got a basic key frame animation (using animation component, legacy rig). I need to be able to dynamically change its play speed. For input I have current time value of the anim (normalized). I ve been trying to use animation.sample as it sounds appropriate, and it does work when called once, but doesnt work if called on update ( Id guess the mesh is qued to update next frame, but since im calling it every frame it does nothing till its stopped being called).

my current code

                foreach (AnimationState state in animRef)
                {
                    state.enabled = true;
                    state.weight = 1;
                    state.normalizedTime = TimeAlpha;
                    animRef.Sample();
                    state.enabled = false;
                }

is there something i can add to force the update or another way achieving this goal

thanks in advance

face palm moment, looked at the code a day later, wasnt in the root of the update block, so it only got fired once, hence its behavoir was exactly as coded :P. Now working how i wanted it to :stuck_out_tongue: