Return value#
| Type | Meaning |
|---|---|
any, ... |
One result per requested field. The name field in this example is string; other fields have their own contracts. |
Observed form#
Layer: game Lua UI. component is a script component ID in the representation expected by this function; name selects the field. Resolve the object in the current process first. The function does not automatically create the component variable.
local name = GetComponentData(component, "name")What happens: For a valid component reference, name receives its name; an object named Scout yields the string "Scout". The value is not logged automatically.
Project observation#
After renaming, read the real object's name and compare it with the expected result. Updating your own window text is not proof that the game object changed.
Type mistakes#
Do not pass FFI cdata merely because it refers to an object. Navigation research found different conversion paths for UI handles, numeric IDs and UniverseID. Field support and return types depend on the query; this article documents name readback rather than every supported key. See ID precision.