Skip to content

Add GetComponent(type) and GetBehaviour(type) to the Actor Lua bindings #777

@Gopmyc

Description

@Gopmyc

Problem this feature should fix

The current Actor Lua API exposes many hardcoded getters (GetCamera, GetLight, etc.) and GetBehaviour(name), but there is no generic lookup by type. This makes scripts more verbose, less scalable, and harder to write in a data-driven way when the component/behaviour type is only known at runtime.

Expected solution

Add two generic Actor bindings in Lua:

  • GetComponent(type)
  • GetBehaviour(type)

Both should resolve from a type identifier and return the matching instance, or nil when not found. Existing explicit getters should remain supported for backward compatibility.

[Related to #689]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions