Skip to content

Add Actor::FindChild method and expose it to Lua#802

Merged
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:798
May 11, 2026
Merged

Add Actor::FindChild method and expose it to Lua#802
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:798

Conversation

@Gopmyc
Copy link
Copy Markdown
Contributor

@Gopmyc Gopmyc commented May 11, 2026

Description

This PR adds a new Actor::FindChild method to search a child actor by name within an actor hierarchy.

Changes included:

  • Added Actor::FindChild(const std::string& p_name, bool p_recursive) const to the C++ Actor API.
  • Implemented the search logic in Actor.cpp:
    • first checks direct children,
    • then checks descendants recursively when p_recursive is true,
    • returns the first matching actor or nullptr.
  • Exposed FindChild to Lua in LuaActorBindings.
  • Updated Lua API stubs (Resources/Engine/Lua/Scene/Actor.lua) with the new method signature.

Related Issue(s)

Fixes #798

Review Guidance

Please review in this order:

  1. Sources/OvCore/include/OvCore/ECS/Actor.h (new method declaration)
  2. Sources/OvCore/src/OvCore/ECS/Actor.cpp (method implementation)
  3. Sources/OvCore/src/OvCore/Scripting/Lua/Bindings/LuaActorBindings.cpp (Lua binding)
  4. Resources/Engine/Lua/Scene/Actor.lua (Lua API stub update)

Screenshots/GIFs

N/A

AI Usage Disclosure

N/A

Checklist

  • My code follows the project's code style guidelines
  • When applicable, I have commented my code, particularly in hard-to-understand areas
  • When applicable, I have updated the documentation accordingly
  • My changes don't generate new warnings or errors
  • I have reviewed and take responsibility for all code in this PR (including any AI-assisted contributions)

@adriengivry adriengivry merged commit 69ddbd8 into Overload-Technologies:main May 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add Actor::FindChild method

2 participants