TL;DR:
I need to create arbitrary interactive elements within a parent BP, but it doesn’t seem like child BP actor properties can be modified within the parent so I can’t “wire up” separate child elements to talk with one another.
Context:
I’m trying to make a large submarine-like vehicle with a variety of interactive elements onboard. The player would be able to freely move around inside and perform various actions like storing items or opening/closing windows.
For the vehicle, I’ve made a blueprint actor and for the interactive elements I’ve made a generic interactable actor component + interactor on the player that works on a system of delegates. I can add an interactable component to a BP and then subscribe to various interaction events.
This is an actor implementing the interactable component:
Problem:
For most elements on the vehicle, the interaction system works perfectly fine. A storage locker can easily be made by creating a chest BP actor with the interactable component on it and having it manage its own logic internally. The problem comes into play when I want to have the button and interactive element placed separately.
Take the window example: I want to place a window shutter on the outside of the vehicle somewhere that opens and closes in response to a button that I place somewhere arbitrarily on the inside. I don’t want this to be a single BP actor because then I’m managing the button and window placement inside the child, when it should just be done in the parent (vehicle) BP. However, while I can easily make a shutter BP and a button BP, I don’t know how I link them together.
In a scene, would be as easy as creating a button BP and referencing the window BP in some receiver property on the instance, but that doesn’t seem possible in a parent BP. I don’t know how to wire across these two child BPs when I can’t control their properties in the parent.
So how would I go about architecting this? Do I have to make the window and button scene components? It seems strange that I’d need to make a completely separate component to make this work. I’d prefer to just make a button actor that I can wire up to anything, in the scene or a parent BP.