How to send parameters with UButton OnClicked?

Hello guys,

So at the moment I made 2 levels and I want to use the same function for both the buttons. In the function I need to know which button is clicked, so I can open the right level. I can’t find anything on the internet. Can someone else help me with this?

Code at the moment:

225553-vragenue42.png

Hey there, use this.

Thanks for your reaction.
I already tried that and I had the same name with both buttons.

Do I need to make a slate widget for this?

Instead of sending the name on the delegate, send the button itself, that way you can compare the instance itself.

Hey, sorry for my late reaction. I already sorted it out with the link that you wrote. I didn’t knew there was a class to create a customized button.

Maybe try this

FOnClicked::CreateStatic(&YOURFUNCTION, Parameter1, Parameter2)

or

FOnClicked::CreateSP(this, &YOURFUNCTION, Parameter1, Parameter2)