segunda-feira, 17 de abril de 2017

BP Compendium 3: Set Input Mode Game and UI

Set Input Mode Game and UI


Defines an input mode in which the User Interface (UI) has priority in handling user input events. If the UI does not know how to handle a particular event, it is passed on to the Player Controller to be handled.

Input
  • Target: A reference to the PlayerController.
  • In Widget to Focus: A reference to an UMG Widget.
  • In Mouse Lock Mode: Indicates how the mouse will be handled.
  • Hide Cursor During Capture: Indicates whether the mouse cursor should be hidden.

Example Usage: 

In a "First Person" game where the mouse is used to modify the player's vision, there is a blueprint that interacts with the player. When the player approaches this blueprint, a panel is displayed with options for the player to choose using the mouse. The "Set Input Mode Game and UI" function causes the mouse to control the cursor so that it can interact with the panel instead of changing the player's view. To exit the panel, simply move away from the blueprint using the WASD movement keys.

Click to enlarge

The "Panel Options" variable represents a UMG Widget that was previously created in the "Begin Play" event. As the player approaches the blueprint, the "Panel Options" is displayed on the screen via the "Add to Viewport" function.

The event below shows the actions required to return to normal input game mode and hide the panel when the player moves away from the blueprint. 

Click to enlarge


Table of Contents