Godot says in a line of code that it's missing a ")" but there is a ")" so what's up with that?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Noob_Maker
:warning: Old Version Published before Godot 3 was released.

Yeah, It gives me that error but that paracentesis is already there. ‘-’
Here’s the line Godot is unhappy with: Right = Input.is_action_pressed ("right")

Yeah…

Edit: Here’s the longer version:

func _fixed_process(delta):
CollisionShape.set_extents(Vector2(get_size)
Right = Input.is_action_pressed ("right")
Left = Input.is_action_pressed ("left")
Jump = Input.is_action_pressed ("jump")
LSprint = Input.is_action_pressed("left_sprint")
RSprint = Input.is_action_pressed("right_sprint")
if Right == true:
	set_linear_velocity(Vector2 (s, get_linear_velocity().y))
elif Left == true:
	set_linear_velocity(Vector2(-s, get_linear_velocity().y))
else:
	set_linear_velocity(Vector2 (0, get_linear_velocity().y))
if is_on_ground():
	if Jump: 
		set_axis_velocity(Vector2(0,-jumpforce))

Can you show more code? maybe is a previous line and the editor “thinks” it was a line break.

eons | 2017-01-02 23:54

:bust_in_silhouette: Reply From: volzhs

I see no right parentheses on CollisionShape.set_extents(Vector2(get_size)

Oh…BUT WHY WAS IT TARGETING THE “go right if this command is stated” PART?! Egh, silly godot, silly me. Thanks.

Noob_Maker | 2017-01-03 01:41

That’s normal. This code is valid as you can split expressions in parentheses using newlines:

CollisionShape.set_extents(Vector2(
get_size)
)
print("Test")

but this one isn’t, and it would highlight the print statement because it was looking at it to find the missing parenthesis:

CollisionShape.set_extents(Vector2(
get_size)
print("Test")

Akien | 2017-01-03 15:14