Walking Components
how to inspect and walk the Actor Component Hierarchy
Last updated
how to inspect and walk the Actor Component Hierarchy
Last updated
This page covers how to walk the Actor Components s in a 3D Level akin to the Details panel:
Compared to the Actor Hierarchy, Components appear deceptively simple to iterate over with a recursive function:
After getting our Actor reference, we can start from the root_component reference:
If we compare the results of this function to the Details Panel, we'll notice quite a few extra lines:
This is because the function_test Blueprint Asset spawns child actors. If we only want to view the immediate components of our given actor we can add a get_owner() check to confirm the component is directly managed by the given actor:
This added step gives us a printout that better matches the Details Panel: