system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
Torvic |
I’m using this Virtual Joystick on my game and I don’t know where to put the flip_h = true
if joystick and joystick.is_pressed():
position += joystick.get_output() * speed * delta
$AnimatedSprite.animation = "run"
$AnimatedSprite.playing = true
else:
$AnimatedSprite.animation = "idle"
system
2
|
|
|
|
Reply From: |
estebanmolca |
Hi, this should work:
if joystick and joystick.is_pressed():
position += joystick.get_output() * speed * delta
$AnimatedSprite.animation = "run"
$AnimatedSprite.playing = true
if joystick.get_output().x < 0:
flip_h = true
if joystick.get_output().x > 0:
flip_h = false
else:
$AnimatedSprite.animation = "idle"
IT WORKED!! Thank you so much <3
Torvic | 2022-08-17 23:11