Best way to aggregate BPs

I have a BP which consists of a tile mesh and some code. When you step on the tile, it moves down. Next time you step on it, it releases again.

I want to make a bigger asset consisting of 9 of these tiles, making a panel. Eventually, other copies of that asset, making a path.

  1. Attempt #1. I put 9 tile meshes into a BP and wrote a load of code to control them. Very messy. I had arrays of tiles, arrays of collision boxes. When the player triggers a collision, I have to figure out which tile it was. Yada yada yada.

  2. Attempt #2. I made a BP consisting of one tile mesh and some code. Very elegant coding. Behaves as expected. I then made 9 separate copies of the BP and put them in the world. Spent time carefully arranging them and then grouped the result. It works much better, but I can’t help thinking there’s some way to get the whole thing into one BP, rather than messing around with separate actors and grouping like this.

  3. Attempt #3. I made an empty BP and inserted the tile BPs as child actors. This gives me one thing I can drag around the level and duplicate, lovely. It works as expected, the tiles do function. But… I can’t talk to any of the children from the parent. I need to be able to manage the states of the children, ie, know when they are up / down, trigger events etc. I drag a pin from one of the child actors in the parent and can’t see any variables or events.

How is this ‘supposed’ to happen?..

Thankyou!

But… I can’t talk to any of the
children from the parent.

You can like so:

270498-capture.png


Do consider some automation for this, you can spawn child actor components on the go and chuck them into an array, and register dispatchers to help with communication. The main blueprint could implements some constructor callable methods that add the tiles dynamically.