How to target the object BP your character is "holding"

I think you can do something like this;

Make an integer variable in you piece blueprint called ‘piece number’ and make it editable and expose on spawn so that you can change the number of the piece when it’s in the world or when enemies drop/ spawn them

Make another integer variable in your character blueprint and set this in the code piece blueprint after you’ve attached the code piece to your character, so whatever number piece number you picked up is the piece you have

In the interact wall blueprint after you’ve called ‘place code’ make a ‘switch on int’ node with exec pins connecting to ‘attach actor to component’ nodes with different slots

Make a ‘which slot next?’ int variable which will change the selection of the slots

Change the value of ‘which slot next?’ by setting it to 1 after you’ve used slot 0 which is now filled

And the ‘code piece’ that you ‘GET’ depends on what piece you’re holding if you get the ‘piece i’m holding’ from your character blueprint

So this should make sure the slots are filled like 1, 2, 3 and that you attach whatever piece you’re holding to the wall

Hope this helps :slight_smile: