How to control actors with the same parent class?

Hi! I am a beginner and trying to control actors with the same parent class together using Blueprints.

I have an Earth actor and a Moon actor, and they have the same parent class Planet. I wonder if it is possible to make both of them stop revolutions as long as any one of them is clicked.

My first thought was to use a static variable in Planet to control but found it seemed there was no static variable in Blueprint. Are there any other ways?

Many thanks!

Put common code in parent class, this is exactly what are parent and child classes for.

1 Like

I want to do so but don’t know how to realize it. Could you give more hints like which function in Blueprints I should use? Thank you!

This looks like decent tutorial:

Keywords for uncle google:
inheritance blueprints unreal

Thank you! Maybe I didn’t express my question clearly but now I have found the solution.


My solution is to set tags and use a function called “Get All Actors With Tag” in the Planet blueprint.

1 Like