Thursday, July 17, 2025
HomeGame Developmentgodot - Why cannot I entry customized properties clearly declared with _get_property_list()?

godot – Why cannot I entry customized properties clearly declared with _get_property_list()?


I’ve the next script hooked up to a easy management node designed to create a customized property “label”:

@device
extends Management

func _get_property_list() -> Array:
    return [
         PROPERTY_USAGE_SCRIPT_VARIABLE,
            "hint_string": "Text label to display", # Doesnt work in editor. "No description"
            "hint":"No idea if this works"  # Doesnt work in editor. "No description"
        
    ]

func _set(property: StringName, worth) -> bool:
    match property:
        "label":
            self.identify = worth
            print(self.label)  #Doesnt work
            print(self["label"]) #Doesnt work
            print(self.get_property_list())  # Clearly reveals that the property "label" is current
            return true
        _: return false

Nevertheless, as famous within the code feedback, the customized property label:

  1. Has no trace within the inspector
  2. Can’t be dot-addressed
  3. Can’t be key-addressed

Related output of print(self.get_property_list()):

 { "identify": "label", "class_name": &"", "sort": 4, "trace": 0, "hint_string": "Textual content label to show", "utilization": 6 }]

It’s principally a “faux” property proper now. How can I make it right into a “actual” property that may be dot-addressed and such?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments