Directional sprite doesn't turn around and stays static

Godot Version

godot 4

Question

i tried making a directional spite based on this tutorial , made the same sprite sheet with same amount of columns and rows, etc. followed every step but my sprite stays static. someone said that it needs some corrections if we use godot 4 (my case exactly). i added “@” to export, etc, but nothing worked. what did i miss?

D you call set_camera(camera) anywhere? If no your script wont run because of

if camera == null:
    return

Make sure that you set the camera

i set it after your advice, ty, but the sprite still remains static in the scene, sadly :smiling_face_with_tear:

you probably meant to call the method “_process” and not “process”. Otherwise it wont be called by the engine. “_process” is a built-in method that gets called every frame

1 Like

oh yup. fixed it, still doesn’t work xDD the code runs but the sprite is static no matter what angle i look at it from

can you put print-calls in the if-statements to check if they are being called?

i tried doing it but nothing changed i guess, hm

Nothing is supposed to change.

if f_dot < -0.85:
    print("front")
...
elif f_dot > 0.85:
    print("back")
...

Do something like this and check in the output tab if stuff gets printed

oh i got it!
alright, nothing prints in output. literally nothing. huh…

then this method probably doesnt get called. Can you put your code here
and use the intended preformatted text
grafik