The editor is asking for ", or )" where there is no need for it

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ZSakaro

I’m a total noob in GDscript and i lately started following a course on how to make a 2D platformer from udemy
i followed everything but in

"func adjust_flip_direction(input ; Vector2 );"

it keeps asking for , or )
please help

extends KinematicBody2D

export(float) var move_speed = 200
export(float) var jump_impulse = 600
enum STATE { IDLE, RUN, JUMP }

onready var animation_sprite = $AnimatedSprite
onready var animation_tree = $AnimationTree

var velocity : Vector2

var current_state = STATE.IDLE setget set_current_state
var jumps = 0

# warning-ignore:unused_argument
func _physics_process(delta):
	var input = get_player_input()
	adjust_flip_direction(input)
	
	velocity = Vector2(
		input.x * move_speed,
		min(velocity.y + Global.gravity, Global.terminal_velocity)
	)
	
	velocity = move_and_slide(velocity, Vector2.UP)
	
	set_anim_parameters()
	
	pick_next_state()
	
func adjust_flip_direction(input ; Vector2 );
	if(sign(input.x) == 1):
		animated_sprite.flip_h = false
	elif(sign(input.x) == -1):
		animated_sprite.flip_h = true
func set_anim_parameters():
	animation_tree.set(("parameters/x_move/blend_position"),sign(velocity.x))
	
func pick_next_state():
	if(is_on_floor()):
		jumps = 0
		
		if(Input.is_action_just_pressed("Up")):
			self.current_state = STATE.JUMP
		elif(abs(velocity.x) > 0):
			self.current_state = STATE.RUN
		else:
			self.current_state = STATE.IDLE
	else:
		pass

func get_player_input():
# warning-ignore:unassigned_variable
	var input : Vector2
	
	input.x = Input.get_action_strength("Right") - Input.get_action_strength("Left")
	input.y = Input.get_action_strength("Down") - Input.get_action_strength("Up")
	
	return input
 
func jump():
	velocity.y = -jump_impulse
	jumps += 1
	
# SETTERS
func set_current_state(new_state):
	match(new_state):
		STATE.JUMP:
			jump()
	
	
	current_state = new_state
:bust_in_silhouette: Reply From: kidscancode

You’ve written ; instead of : (in two places):

func adjust_flip_direction(input : Vector2 ):

I just tried and it says “the identifier “animated_sprite” isn’t declared in the current scope.”

ZSakaro | 2021-11-20 16:29

Well, that’s because you don’t have a variable named that. You’ve declared one called animation_sprite at the top of your script…

kidscancode | 2021-11-20 16:35

oh… now it works, thanks :slight_smile:

ZSakaro | 2021-11-20 16:43