Expected indented block after "if" block_

godot 4

extends Sprite2D


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

what it is saying that for the function horizontal_behaivor
it is expecting an indent. because you used a # for the play run nothing is called. there is no code there and if it meets the condition then it wont know what to do. try putting this
if direction.x !=0:
pass
this will just skip the function and nothing will happen

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.