For some reason I get the error, "Expected closing ")" after call arguments." for the last line in the function:
func _process(delta: float) -> void:
if Input.is_action_just_pressed("melee"):
is_attacking = true
melee(is_jumping: bool, is_falling: bool)
is_falling and is_jumping are defined and called from another module. They work, only the melee function is busted.
func _physics_process(delta: float) -> void:
gravity_component.handle_gravity(self, delta)
movement_component.handle_horizontal_movement(self, input_component.input_horizontal)
jump_component.handle_jump(self, input_component.get_jump_input(), input_component.get_jump_input_released())
animation_component.handle_move_animation(input_component.input_horizontal, gravity_component.is_falling, jump_component.is_jumping)
animation_component.handle_jump_animation(jump_component.is_going_up, gravity_component.is_falling)
animation_component.melee(gravity_component.is_falling,jump_component.is_jumping)
If I remove the ": bool" from the melee function call, it gives the error, "Identifier "is_jumping" not declared in the current scope."
If I leave it as "melee()", it tells me it expects 2 arguments.
I can make it kind of work by defining the variables again locally and not call on a different module, but I want to keep my code clean and other functions are calling on the same variables successfully. For example:
func handle_move_animation(move_direction, is_jumping: bool, is_falling: bool) -> void:
handle_horizontal_flip(move_direction)
if move_direction != 0 and not is_jumping and not is_falling and not is_attacking and not is_look_down and not is_look_up:
sprite.play("run")
elif not is_attacking:
sprite.play("idle")
Could someone please explain why calling the same variable from another module works on one function and not the other?