Hi I wanted to check my previous animation before setting a new one via code, something like this:
var new_animation = ""
var new_scale_x = 0.237
if Sprite.get_animation_state() != new_animation:
Sprite.get_animation_state().set_animation(new_animation, true, 0)
This is so my animation doesn't get called multiple times during _physics_process and only gets called if the animation is not playing already.
At the moment it is giving me error as I am comparing an object to a string.
I would really appreciate any help.