Invalid call to function '…' in base '…'. Expected N argument(s) in Godot 4
The function was called with a different number of arguments than it declares. target.take_damage() on a function declared take_damage(amount: int) stops with Invalid call to function 'take_damage' in base 'Node (repro.gd)'. Expected 1 argument(s); pass the argument, target.take_damage(10), or give the parameter a default value.
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
When a GDScript function is called, the VM compares the number of arguments passed with the number the function declares. Fewer than its parameters without a default value is too few, and the error's number is that count. More than all its parameters, on a function that is not variadic, is too many, and the number is the full parameter count.
The base in the message names what the call ran on: the class of the object, then the script attached to it in brackets, here 'Node (repro.gd)'.
It is a runtime error: the script parsed, and the error appeared when the line ran. The function that made the call stops there, so the print("after") below it never ran, as the output shows.
The analyzer has its own check, which stops the script at parse time with Too few arguments for "take_damage()" call. Expected at least 1 but received 0. In the repro the call goes through an untyped variable, var target = get_node("."), and the run shows that it parsed and failed only when it ran.
More on this: Invalid type in static function 'from_angle' in type 'Vector2'. Cannot convert argument 1 from String to float in Godot 4
Reproduce it
A node with a take_damage(amount) function, called through an untyped variable with no argument.
More on this: Trying to call an async function without "await" in Godot 4
extends Node
var health := 100
func take_damage(amount: int) -> void:
health -= amount
func _ready() -> void:
var target = get_node(".")
target.take_damage()
print("after")
What Godot 4.7.2 prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Invalid call to function 'take_damage' in base 'Node (repro.gd)'. Expected 1 argument(s).
at: _ready (res://answers/invalid-call-to-function-expected-arguments/repro.gd:10)
GDScript backtrace (most recent call first):
[0] _ready (res://answers/invalid-call-to-function-expected-arguments/repro.gd:10)Fix it
Pass the argument the function declares.
extends Node
var health := 100
func take_damage(amount: int) -> void:
health -= amount
func _ready() -> void:
var target = get_node(".")
target.take_damage(10)
print("health ", health)
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
health 90Run this fix with your agent
Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.
My Godot 4 project prints this error: "Invalid call to function 'take_damage' in base 'Node (repro.gd)'. Expected 1 argument(s).". Find where it comes from and fix it. The function was called with a different number of arguments than it declares. target.take_damage() on a function declared take_damage(amount: int) stops with Invalid call to function 'take_damage' in base 'Node (repro.gd)'. Expected 1 argument(s); pass the argument, target.take_damage(10), or give the parameter a default value. Then run the game headless and check that Godot's output no longer shows it.Too many arguments names the full count
Passing more arguments than the function declares fails the same way, and the number is every parameter, defaults included. A function declared take_damage(amount: int, source = null) called with three arguments reports Expected 2 argument(s); called with none it reports Expected 1 argument(s), because source has a default.
A function that takes no arguments reports Expected 0 argument(s) when it gets one: target.reset(1) on a func reset() -> void prints Invalid call to function 'reset' in base 'Node (repro.gd)'. Expected 0 argument(s).
func take_damage(amount: int, source = null) -> void:
health -= amount
The same error in earlier Godot versions
Godot 4.2 and Godot 3.6 printed it as: Invalid call to function '…' in base '…'. Expected 1 arguments. The cause and the fix are the same.
More on this: Unable to obtain iterator object of type 'Object' (but was obtained on first iteration?) in Godot 4
Verified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 6 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: gdscript_vm.cpp line 182, the message, gdscript_vm.cpp lines 561 to 573, the argument count check, gdscript_vm.cpp line 2108, the function and base in the message, gdscript_analyzer.cpp line 6075, the parse-time check.
Questions
- Why does the message say 'Expected 1 arguments' in my Godot version?
- Godot 4.2 and Godot 3.6 print Expected 1 arguments. Godot 4.7.2 prints Expected 1 argument(s). It is the same check.
- Why didn't the editor flag the call?
- The analyzer checks the argument count when it knows which function is called. Through an untyped variable it does not, so the call is checked when it runs, as in the repro.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free