G
Grobe-Street

  • Mar 6, 2023
  • Joined Feb 17, 2023
  • 0 best answers
  • When I try to use the GDScript code below, Godot gives me the error:

    error(3, 34) Error parsing expression, misplaced: Built-In Func
    Why am I getting this error, and how can I fix it? Thank you in advance)

    func _on_MoneyTimer_timeout():
    	var money_scene = load("res://Money.tscn").instance()
    	money_scene.position = Vector2((randi % 0 + width_project), (randi % 0 + height_project))
    	add_child(money_scene)
    • Which line produces the error message?

      Is randi declared as a variable? If you're trying to use it as a function, it needs parentheses: randi()