Hello,
I want to know how to create a serie of buttons side by side and they have a different function.
Thank you beforehand.
Hello,
The best way to create buttons in your game is to make use of UMG. You can find the documentation on UMG here: UMG UI Designer | Unreal Engine Documentation
First, you’ll need to create a new Widget Blueprint:
Open the widget blueprint, and then add a few buttons to the canvas panel. You can do that by dragging the Buttons from the Palette onto your Canvas Panel:
I added two buttons, but feel free to add as many as you need, and format them in any way you’d like. In order to get the logic working on your buttons, you’ll need to add an OnClicked event. To do this, select one of your buttons, and in the Details panel click the + next to OnClicked. This will add the event and take you to your Event Graph.
From here, you can add the functionality that you would like your buttons to have. Each button will have a separate OnClicked event, so you can customize the functionality on a per-button basis.
Feel free to let me know if there are any further questions.
Have a great day,
Sean Flint
Thanks for your answer.
But I talked button in the game.
Once you’ve created the buttons as detailed in the steps above, you can go into your Level Blueprint, and on Event Begin Play add a Create Widget node (ensure that you select your Widget blueprint from the dropdown), and then connect the return value of the Create Widget node to an Add to Viewport node. This will display the widget on your screen when you PIE.
Thank you for the clarification, but I meant the buttons in the game with a model like elevator buttons.
If you run a search here Unreal Engine 5 Documentation | Unreal Engine Documentation and search for Elevator Button, this is the first result that you will see https://answers.unrealengine.com/questions/335628/elevator-button-blueprints.html
I speak as a button in a control room