Get property list() cant get to work

Godot Version

4.2.1

Question

hello, does anyone know how to get this code to work ?
its laways erroring
Wrong type for _get_property_list, must be an array of dictionaries.
Wrong type for _get_property_list, must be an array of dictionaries.

(9 example tasken from manual )

gewt propretry list

@export var holding_hammer = false:
	set(value):
		holding_hammer = value
		notify_property_list_changed()


var hammer_type = 0

func _get_property_list():
	# By default, `hammer_type` is not visible in the editor.
	var property_usage = PROPERTY_USAGE_NO_EDITOR
	if holding_hammer:
		property_usage = PROPERTY_USAGE_DEFAULT
	var properties = []
	properties.append({
		"name": "hammer_type",
		"type": TYPE_INT,
		"usage": property_usage, # See above assignment.
		"hint": PROPERTY_HINT_ENUM,
		"hint_string": "Wooden,Iron,Golden,Enchanted"
	})

You need to add return properties at the end of the function.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.