Multiple Interactions with blueprint interface

Hi, I’ve been trying to get this to work for a few hours now, I feel like I’m being dumb and the solution is staring me right in the face but I’m not seeing it.

I have a simple interaction system at the moment using a blueprint interface where I can click a button and it fires and action, turning on lights, opening doors, spawning items ect…

The issue I’m having is that I would like to make it so I have multiple buttons which need to be pressed before this action takes place. I’ve attached some images below for context.

001

Light with one input.

003

Blueprint is relatively simple using line trace in the player bp.

004

What I’d like to be able to have working.

1 Like

An idea:

  • You could have each button as a separate blueprint: on trace hit, they toggle.
  • The light has an array of the buttons to know how many have to be toggled and also to bind the event of toggled on and off to ++ or – the int.
  • On each toggle the light bp checks if that int == the total number of buttons, if not then do nothing.

ToggleMultBtns

1 Like

If you want a ‘keypad’ kind of scenario, then it’s best to put all the buttons in one BP.

When you send the ‘clicked’ message, you can also send a reference to the component that was hit.

3 Likes

This is what I have in my head on how I’d like it to work. I’m still learning so I have no idea if this is even possible or how the BP would be configured.


I was hoping to be able to have an additional BP which goes between the input/output.

1 Like

It’s certainly possible. I’m not sure what the advantage would be, apart from being able to map what happens.

You would end up with 3 blueprint interface calls, instead of 1, though ( for any interaction ).

2 Likes

Light BP:


the light BP needs an instance editable array that references each button. That is how it knows how many have to be turned on.

Button BP:


image


ToggleMultBtns02

1 Like

I was thinking it would give me a lot more flexibility going forward. Meaning I would be able to add any interaction to this BP and any output.

Maybe I’m just over-complicating things, like I say I’m still learning so not really sure what the best approach would be.

I’ll give this a try to see if I can get it to work for me, thank you for the help! :smiley:

I think one BPI is enough. Because you can walk up to any object ( actor ) and say ‘hey, I’m interacting with you’. What the BP does with that information can be totally different depending on what is implemented for the interface call.

Found a way to get the way I wanted it to work, more blueprints which can probably be simplified however at the moment it’s easier for me to understand how it’s working and the blueprints themselves are relatively simple.


Takes the player input for multiple buttons

When the button is pressed set all linked lights to on.

If all are set to on, start the action (in this instance open the door).