Godot Version
Godot 4.1.1
Question
Having a problem with @explore…
here is the code
extends Node
@export (PackedScene) var Ball # This line specifically is the problem
func _input(event):
if event.is_action_pressed(“click”):
var new_ball = Ball.instantiate()
new_ball.position = get_viewport().get_mouse_position()
add_child(new_ball)
Error message is as follows;
Annotation “@export” requires at most 0 arguments, but 1 were given.
I got this script from a tutorial that was based in godot 3.something.
I’ve tried resolving this by removing the parenthesis etc, or putting the variable = PackedScene yet i get a different error every time or the script doesn’t run.
I’m new to Godot and am watching tutorials to get a feel of the engine and the language as I’m also not a very skilled programmer. Therefore i would really appreciate if anyone could help resolve this error.
Thank You!