Fully Encapsulated Actor Components?

I am working on a design for a few Actor Components, and am struggling with how to properly resolve dependencies between them. Ideally, each Actor Component should be fully encapsulated, and not rely on other Actor Components. But some are so closely related, that dependencies seem unavoidable. For example; an Actor Component that handles Attacks will need to apply damage and therefore has a dependency on the Health Actor Component. Likewise, an Inventory component will have a similar dependency on the Interaction Actor Component, as you must first interact with an item in order to pick it up.

What is the best way to avoid, or to handle these dependencies? Is a fully encapsulated Actor Component not really achievable?

You could use Event Dispatchers or Blueprint Interface for it. For example:
image




In this example, I’m passing a value from one actor component to another. However, both components are fully encapsulated and don’t have any dependencies.

I hope this will be useful for you.

My Products

Excellent. This should work well. Thank you so much.