So I have been trying to create a projectile that spawns every half a second however, for some reason it can’t duplicate giving me the error “cannot call method instantiate on a null object” however I do have an object named book which is a packed scene, so what am I doing wrong.
@export var book: PackedScene;
var dup
var a = 0
func _process(delta: float) -> void:
a += 1
if a > 30:
var dup = book.instantiate();
add_child(dup,true);
a = 0