Say you have a car composed of multiple actors for each part (like a door actor, wheel actor, radio actor etc.), all attach to the body of the car, for example. I have timelines in some of these actors that I need to wait for before I run code in a different actor.
What’s the best way to approach something like this?
lots of solutions to this but an easy one would be to use GameplayTags on the root actor and listen for Tag events. So each component can add a Tag when its ready and when any tag is added check if all required tags are on
First those parts (door, wheel, radio) sound like components instead of actors. Actors create an overhead and assume independent movement. You won’t be moving the radio or the wheels independently of the car right?
The car is a car because it has 4 wheels and 2 doors etc. Not only that but there are probably no wheels running around without a car. The car already has the pare references (regardless if they are actors or components) and the part can get the car reference on begin play.
From that point on just call methods on the parts and the car directly - they are one entity. Parts can even have references to other parts if they communicate too often. This will make your code faster and more readable but you won’t be able to separate the parts. To be honest, I don’t think you would want to separate them anyway.