Skip to content

Invalid assignment of property or key '…' with value of type '…' on a base object of type 'Node2D' in Godot 4

By Eduardo Orellana · Updated

The node has no property by that name, most often because of a typo. sprite.positon = Vector2.ZERO stops with Invalid assignment of property or key 'positon' with value of type 'Vector2' on a base object of type 'Node2D'. Fix the name (position); the Inspector shows every property's real name when you hover it.

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

What Godot is checking

Setting a property on an object asks the object to set it by name. When neither the class, its parents nor its script has a property of that name, the set fails and the VM reports the name, the value's type and the object's type.

On 4.7.2 this was a run-time error even with the variable typed Node2D, as the run shows: the script loaded, and the line failed when it ran.

More on this: Invalid access to property or key 'position' on a base object of type 'Nil' in Godot 4

Reproduce it

A Node2D whose position is set with a misspelled name.

More on this: In Object of type '…': Attempt to connect nonexistent signal '…' to callable '…' in Godot 4

GDScript
extends Node

func _ready() -> void:
	var sprite: Node2D = Node2D.new()
	add_child(sprite)
	sprite.positon = Vector2.ZERO
	print("after")

What Godot 4.7.2 prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

SCRIPT ERROR: Invalid assignment of property or key 'positon' with value of type 'Vector2' on a base object of type 'Node2D'.
   at: _ready (res://answers/invalid-assignment-of-property-or-key-on-node2d/repro.gd:6)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/invalid-assignment-of-property-or-key-on-node2d/repro.gd:6)

Fix it

Use the property's real name.

GDScript
extends Node

func _ready() -> void:
	var sprite: Node2D = Node2D.new()
	add_child(sprite)
	sprite.position = Vector2(32, 16)
	print(sprite.position)

What the fixed script prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

(32.0, 16.0)

Run 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.

More on this: Cannot find member "…" in base "…" in Godot 4

Prompt
My Godot 4 project prints this error: "Invalid assignment of property or key 'positon' with value of type 'Vector2' on a base object of type 'Node2D'.". Find where it comes from and fix it. The node has no property by that name, most often because of a typo. sprite.positon = Vector2.ZERO stops with Invalid assignment of property or key 'positon' with value of type 'Vector2' on a base object of type 'Node2D'. Fix the name (position); the Inspector shows every property's real name when you hover it. Then run the game headless and check that Godot's output no longer shows it.

A Godot 3 property name

Several properties were renamed in Godot 4: translation is position on Node3D, rect_position is position on Control, and modulate stayed. A Godot 3 name fails this way, or at parse time when the analyzer knows the class.

More on this: Invalid assignment of property or key 'text' with value of type 'String' on a base object of type 'Nil' in Godot 4

The same error in earlier Godot versions

Godot 4.2 and Godot 3.6 printed it as: Invalid set index 'positon' (on base: 'Node2D') with value of type 'Vector2'. The cause and the fix are the same.

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 18 October 2026, and the output above is what Godot printed, unedited.

Where the check lives in Godot's source: gdscript_vm.cpp line 1235, the message.

Questions

How do I find a property's exact name?
Hover it in the Inspector: the tooltip shows the name scripts use. The class reference lists every property too.
Can a script add its own property to a node?
Declare it with var in the node's script. set() on a name the object does not have adds nothing; use set_meta() for ad hoc data.

Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.

Download Flockbay free