Unexpected identifier error

Hi, im making a bullet system and i get this error that i dont know how to fix.

extends Area2D

const RIGHT = Vector2.RIGHT
export(int) var SPEED: int = 200


func _physics_process(delta):
	var movement = RIGHT.rotated(rotation) * SPEED * delta
	global_position += movement

func destroy():
	queue_free()

func _on_VisibilityNotifier2D_screen_exited():
	queue_free()

func _on_Bullet_body_entered(body):
	if body.is_in_group("Player"):
		destroy()

Which line is the error on?

I’d recommend you write out the full error and specify which line the error is on to make it easier to identify the problem

the error is on line 4

Line 4:Unexpected “Identifier” in class body.

you’re missing the @. it should be @export

1 Like

now i am getting this error

Line 4:Annotation "@export" requires at most 0 arguments, but 1 were given.

oh i think it’s because of the (int) part, try this:
@export var SPEED: int = 200

1 Like

omg thank you it worked

1 Like

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