How do I use my C++ Component on a Child Component in a Blueprint

Hey, I just started learning Unreal Engine 5. I completed a tutorial, which taught me how to create and use C++ Components. But now I want to try to create a DoubleDoor Blueprint.

This Doubledoor Blueprint has a doorframe and two doors as child components.
And I also have a C++ Component "Mover "which has a “rotate” Method.

When I add the component to the blueprint, calling the “rotate” method obviously rotates the enitre door(doorframe + both door).

I want to assign the C++ component to the door child components so that only they are rotated when the “rotate” method is called. But I dont know how to do it.

I could obviously write a new C++ component that rotates the child components. But it doesn’t seem right to have two differenct components that have almost the same methods.

What is the best practice solution in such Situations.

Blueprint

Maybe the answer is obvious, but as I said, I just started learning UE5.

Make it a scene component, not just an actor component. Then you’ll be able to attach a Mover to each door, and when it’s attached to something, you can GetAttachParent() to get a reference to the component you need to move.

2 Likes

That’s it. Thanks a lot.
It seems I need to get a better understanding of what each component does first.