Car door

Right click in the Content Browser and make a new BP:

Search for a static mesh component:

You then get a component blueprint that already sports a Static Mesh Component but it now also hosts a graph, can have variables, functions, interface implementation and so on:

image

You can now script all the things the door needs to know about right into the door:

Add Custom Static Mesh Door comps to the car actor, as many as necessary:

image

Each can have a different mesh, exposed variables and so on.

When the trace hits something, message the instance via the interface:

image

The car does not even need to know about it. Which is great. However, it’s trivial for the door the talk to the car and trivial for the car to talk to its doors. Either with Event Dispatchers and Direct Comms or with the Interface the door already has.

Let’s say the car decides to open some of its doors:


This is a great way to build modular actors. Like a shelf with a bunch of drawers, or a robot whose each limb has a life of its own. Or pieces of armour that can be peeled off a tank - each capable of tracking its own status.

Essentially, you end up injecting logic into an otherwise dumb Static Mesh Component. And then build more complex systems out of the now smarter components.