- Edited
hello, Is there a way to make the animation frames to run at the same speed has physics_process ?
Iam using this code to stop the physics_process
if ( pauseTimer >= 0 ):
pauseTimer -= 0.02;
if ( pauseTimer <= 0 ):
pauseTimer = 0;
elif ( pauseTimer != 0 ):
return;
#pass
but the animation has its own process it keeps playing ?
Ive used diferent ways to stop the animation and it works... But the problem is it starts getting 1 cicle of delay with an animation speed above 23 ? This means if i have to stop at frame 1 it will stop at frame 2 because the speed is to high.
func animationPlay(animNodee, animName, AnimSpeed, loop ):
animNodee.frames.set_animation_speed(animName, AnimSpeed);
animNodee.frames.set_animation_loop(animName, loop);
animNodee.play(animName);
if ( pauseTimer != 0 ):
animNodee.stop();
else:
animNodee.play(animName);
pass
player script
"st_attack":
animationPlay(anim, "attack", 30, false );
$hitBox.hitPauseTime = 3.3;
if ( anim.frame == 1 ):
hitBox.disabled = false;
$hitBox.hitFacing = my_direction;
else :
hitBox.disabled = true;
Ive tried diferent ways putting the code right below if ( anim.frame == 1 ), but nothing seems to work. I always get 1 cicle in delay before the engine checks frame 1 shoud be stooped for 3.3 secs
It seems like the best way is to make the animation play at the same speed has the physics_process. If the physics_process returns ( exits the function ) the animation stops. Is there a way to do it ?