Godot VersionPreformatted text
godot4
Question
func animate(direction: Vector2)-> void:
verify_position(direction)
horizontal_behaivor(direction)
func verify_position(direction: Vector2)-> void:
if direction.x > 0:
flip_h = false
elif direction.x < 0:
flip_h = true
func horizontal_behaivor(direction: Vector2)-> void:
if direction.x !=0:
#play run
else:
pass
You don’t have any executable code after your “if” if you don’t want to put anything for now just put “pass” in your “if”.
Exemple:
func horizontal_behaivor(direction: Vector2)-> void:
if direction.x !=0:
#play run
pass
else:
pass
1 Like
system
Closed
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.