Сomposite Objects

Hi everyone
I started making a game about building various mechanisms. Mechanisms will consist of customizable parts, sometimes with physics. I had previous experience in Unity. I have some questions:

  1. AActor::AttachToComponent does not mean that the actor we “attach” will become a ChildActorComponent? If not, then how does it work.
  2. I heard that you should avoid using “ChildActorComponent”. Why?
  1. Attach to component just makes an actor to follow transforms from other actors component. Just that.

  2. I use ChildActorcomponents all the time and I’ve never had any issue with it. Even inside multiplayer. Not a replication issue or things like that. I can have a main character with all the general logic and inside an actor component with all visuals including individual logic (for example an actor that has a cap with a helix that rotates with speed. no need to include this logic inside the main actor. I just add helix logic inside the child actor and inject data from parent actor to child actor thru interfaces) or light that blinks on some events or whatever. Child actors gives you freedom nesting logic away main actors.

Another example. Imagine your character is Predator. You can have a child actor that is attached to the shoulder as a weapon and this child actor has its own logic to aim enemies or stuff like that, but then you can swap that shoulder weapon with other with different logic and main actor is unaffected.

1 Like

Thx for your answer

1 Like