#unrealengine #tutorial
00:00 Click with UMG
05:40 Click with mouse cursor
Creating a Widget Blueprint
The tutorial begins with the creation of a widget blueprint named "BP On-Screen Widget". The process involves adding a canvas panel and a button labeled 'Bounce all the balls'. This UI element will act as a trigger for events in the game.
Adding UI to the Game Viewport
After creating the button, the next step is to add the UI to the screen during gameplay. This is accomplished by manipulating the Level Blueprint to create an instance of the widget and adding it to the viewport when the game starts.
Sending Messages through UI Interactions
When the 'Bounce all the balls' button is clicked, a message is printed to the screen. This section emphasizes the ability to trigger events in the game environment through UI, effectively allowing players to interact with the game using buttons.
Setting Variable Flags for UI Actions
A variable is introduced to control whether actors can jump through the UI's commands. This setup enables the differentiation between which actors are responsive to UI events, illustrated by having only certain balls bounce when triggered.
Mouse Click Interaction Implementation
The tutorial transitions into mouse interactions, explaining how to detect mouse clicks on the game environment. This includes setting up the character's blueprint to recognize what actor is under the mouse cursor and applying actions like jumping based on clicks.
Filtering Actors for Interaction
By modifying collision presets and ensuring only relevant actors respond to mouse interactions, the tutorial shows how to filter which balls will jump when clicked. This ensures precise control over in-game elements based on user input.
Connecting Click Events to Actor Actions
Finally, the tutorial ties everything together by making actors respond to left mouse clicks. Upon clicking on a bouncing ball, a jump action is initiated, allowing for interactive gameplay through mouse input.
Ещё видео!