ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • Quickstart Extended
  • Battle Tutorials
    • Adding Active Time Battles
    • Adding Phase Battles
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • UI Tutorials

Unity UI: Shortcut HUD

In this tutorial we’ll create a Combatant type HUD to display the player’s shortcut slots using the Unity UI system.

Shortcut slots allow the player to store abilities, items, equipment or other inventory content and actions into slots. They can be used via control maps, in menus or, like in this tutorial, displayed in HUDs.

This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials, but can be used in any project. Your project’s UI system should already be set to Unity UI. If not, check the initial setup tutorial for Unity UI.

As with all content when using Unity UI, we’ll set up prefabs. It’s best to do this in the UI Environment Scene, so open it.

Shortcut UI #

A shortcut slot uses the Shortcut UI of the content it contains to display it.

If you haven’t done so, please follow this tutorial to set up shortcut UI. We’ll use the general use and empty slot setups of the tutorial.

Shortcut Slot Prefab #

Next, we’ll set up a prefab handling a shortcut slot – this’ll show the shortcut UI prefab.

Create a ready-to-use shortcut slot setup either using the scene hierarchy’s context menu (ORK Framework > HUD > Shortcut > Prefab: Shortcut Slot Content) or the ORK toolbar (search for: Shortcut Slot Prefab).

Rect Transform #

We’ll control the size of our shortcut slot on the Shortcut Slot Content object.

  • Width
    Set to: 100
  • Height
    Set to: 100

HUD Shortcut Slot Content #

The HUD Shortcut Slot Content handles the shortcut slot, which shortcut UI will be used and how the slot can be used, assigned and how it’s highlighted.

  • Empty UI Key
    Leave this empty.
    We’ll use the default empty shortcut UI – you can define a key here in case you want to use a different shortcut UI.
    When using a key, an empty shortcut UI for the defined key has to be set up in the editor.
  • Assigned UI Key
    Leave this empty.
    Like the Empty UI Key this allows us to use different shortcut UI for assigned slots.

Slot Input Settings #

These settings handle how the shortcut slot can be used or assigned. We’ll mainly use the shortcuts as display in this tutorial, but we’ll enable using the shortcuts by clicking on them.

  • Enable Tooltip
    Enable
    If you’re using a tooltip HUD, this’ll show a tooltip when the cursor is over the shortcut slot.
  • Click Use
    Select: Use
  • Click Count
    Set to: 1
    Shortcuts will be used by 1 click on them.
  • Use Click Use
    Enable

State Changes #

You can show the different states of a shortcut by either using a color or enabling/disabling an object (e.g. using a different background image on the slot). Each state also has a setup for normal and highlighted state – highlighted is when the cursor is above the shortcut slot.

We’ll set up color changes.

Empty State

This state is used by empty slots.

  • Use Color (Normal State)
    Enable
  • Color (Normal State)
    Select a white color with full alpha (i.e. A=255 or 1, depending on your color picker).
  • Use Color (Highlighted State)
    Enable
  • Color (Highlighted State)
    Select a yellow color with full alpha.

Active State

This state is used when a shortcut is active, e.g. while using an ability or selecting a target for an item, etc.

  • Use Color (Normal State)
    Enable
  • Color (Normal State)
    Select a green color with full alpha.
  • Use Color (Highlighted State)
    Enable
  • Color (Highlighted State)
    Select a yellow color with full alpha.

Useable State

This state is used when the shortcut can be used.

  • Use Color (Normal State)
    Enable
  • Color (Normal State)
    Select a white color with full alpha.
  • Use Color (Highlighted State)
    Enable
  • Color (Highlighted State)
    Select a yellow color with full alpha.

Inactive State

This state is used when the shortcut can’t be used.

  • Use Color (Normal State)
    Enable
  • Color (Normal State)
    Select a red color with full alpha.
  • Use Color (Highlighted State)
    Enable
  • Color (Highlighted State)
    Select a yellow color with full alpha.

In case you also use passive abilities that can be toggled on/off, you can use the Passive Ability states to highlight them.

Image #

Add an Image component to the object using the component menu.

We’ll use it to show a background image for the slot.

  • Source Image
    Select: BoxBlue
    Or any other background image you want

UI Color Changer #

Add an UI Color Changer component to the object using the component menu.

The color changer is used to change the highlight colors – it can also change the color of the displayed shortcut, but we’ll disable this and only change the background.

  • In Children
    Disable

Create Prefab #

The finished object will look like this:

Create a prefab out of our Shortcut Slot Content object (without the Canvas). E.g. name the prefab Shortcut Slot.

You can now remove the object from the scene.

HUD Prefab Setup #

We’ll continue with setting up the prefab of the actual HUD.

Create a HUD with horizontal layout either using the scene hierarchy’s context menu (ORK Framework > HUD > HUD (Horizontal Layout)) or ORK toolbar (search for: HUD Horizontal).

Rect Transform #

I’ll show my HUD at the bottom center of the screen, and it’ll show 9 slots, use a padding and spacing of 10 – so in total, it’ll have a size of 1000×120.

Select a bottom center anchor preset.

  • Pivot
    Set to: X=0.5, Y=0
  • Pos X
    Set to: 0
  • Pos Y
    Set to: 0
  • Width
    Set to: 1000
  • Height
    Set to: 120

Horizontal Layout Group #

We’ll adjust the horizontal layout, using a padding/spacing of 10 and also prevent it from changing the shortcut slot’s size.

  • Padding
    Set all to: 10
  • Spacing
    Set to: 10
  • Control Child Size
    Disable Width and Height.

Image #

Add an Image component to the object using the component menu.

We’ll use it to show a background image for the HUD.

  • Source Image
    Select: BoxBeige

HUD List Content #

Add a HUD List Content component to the object using the component menu.

This’ll list our shortcut slots using the shortcut slot prefab we set up.

Prefab Settings #

  • Prefab
    Select: Shortcut Slot

List Settings #

  • List Type
    Select: Shortcut Slot
  • Slot List Type
    Select: Range
    We’ll display a range of slots, from a start index to an end index.
  • Group Shortcut
    Disable
    We’ll display a combatant’s individual shortcut slots.
    Groups can also have shortcut slots shared by all members of the group.
  • Shortcut List Index
    Set to: -1
    This’ll display the currently active shortcut list and allows us to switch shortcut lists (if we use multiple).
  • Slot Start Index
    Set to: 1
    This largely depends on how you use your slots, e.g. if you start with index 0 or 1, etc.
    I’ll start with index 1.
  • Slot End Index
    Set to: 9
    Similarly, this depends on the start index  – we want to display 9 slots, so I’m using the end index 9.

I’m displaying slots 1-9, so 9 slots in total.

Create Prefab #

The finished HUD should look like this:

And that’s it for the HUD prefab – create a prefab out of our HUD object (without the Canvas). Name the prefab Shortcut HUD.

You can now remove the object from the scene.

HUD Setup #

Open the ORK editor, navigate to UI > HUDs and add a new HUD.

HUD Settings #

  • Name
    Set to: Shortcuts
  • HUD Type
    Select: Combatant
  • Auto Display
    Enable
    This will automatically show the HUD. If you use a HUD only as a  template, make sure to disable this setting.

Combatant Settings #

We’ll only display the shortcuts for the actual player combatant, not for each group member.

  • Only Leaders
    Enable
  • Player
    Enable

Display Conditions #

You can use these settings to only show the HUD based on conditions. E.g. only during battles, etc.

We’ll ignore this for now.

Unity UI #

  • UI Layer
    Select: HUD
  • HUD Prefab
    Select: Shortcut HUD

Schematics #

You can optionally use schematics to animate opening and closing the HUD, e.g. fading it in/out. You can also set up default schematics for all HUDs.

See this tutorial for details.

Shortcut Assignments #

Let’s set up automatic shortcut assignments, i.e. the shortcut slots will automatically be filled with content.

We’ll set slot 1 to use the base attack of the combatant, slot 2-5 will get active abilities and slot 6-9 useable items.

Navigate to Gameplay > Shortcut Settings and change the following settings.

Default Shortcut Assignment #

We’ll start with adding the base attack. This is done as a fixed assignment because the base attack isn’t something the combatant learns or gets at some point, it’s always available.

Click on Add Shortcut.

  • Shortcut List Index
    Set to: 0
    The list index defines which shortcut slot list to use, we’ll put all our slots on list index 0.
  • Shortcut Slot Index
    Set to: 1
    The slot index defines the slot in the list that’ll be used – as said before, we’ll start at index 1.
  • Shortcut Type
    Select: Attack

Default Auto Add Slots #

Abilities or items are received by the combatant at some time in the game, at which point we’ll automatically fill a free slot with their content.

Click on Add Auto Add Slots.

  • Shortcut List Index
    Set to: 0
  • Slot Start Index
    Set to: 2
  • Slot End Index
    Set to: 5

We set which content will automatically be added to the slots in the Used Shortcuts settings.

  • Active Abilities
    Enable

Disable all other shortcut settings.

Optionally you can also limit the used abilities by content type.

Click on Add Auto Add Slots to add another setup, this time for items.

  • Shortcut List Index
    Set to: 0
  • Slot Start Index
    Set to: 6
  • Slot End Index
    Set to: 9

We set which content will automatically be added to the slots in the Used Shortcuts settings.

  • Useable Items
    Enable

Disable all other shortcut settings.

Let’s limit the items to only use potions.

  • Limit Item Type
    Enable

Click on Add Item Content Type.

  • Item Content Type
    Select: Potions

Save Settings #

And that’s it.

Click on Save Settings at the bottom of the editor to save the changes.

Testing #

Hit play and test your HUD!

You can level up your player to get more abilities by using the combatant’s inspector. Select the Fighter (or whatever your player’s object is named) and use the Status Value foldout in the Combatant Component in the inspector. You can add experience to cause level ups.

Tip: Control Maps #

You can use control maps to bind actions to input keys – e.g. a shortcut slot.

Control maps are set up in Controls > Control Maps. You can learn more about them in this documentation.

E.g. to use the 1st slot of the HUD via an input key:

Click on Add Control Key.

  • Input Key
    Select the input key you want to use (e.g. 1).
  • Type
    Select: Action
  • Action Type
    Select: Shortcut
  • Shortcut List Index
    Set to: 0
  • Shortcut Slot Index
    Set to: 1

You can further set up to use group/indivdiual targets or auto targeting, etc.

Table of Contents
  • Shortcut UI
  • Shortcut Slot Prefab
    • Rect Transform
    • HUD Shortcut Slot Content
      • Slot Input Settings
      • State Changes
    • Image
    • UI Color Changer
    • Create Prefab
  • HUD Prefab Setup
    • Rect Transform
    • Horizontal Layout Group
    • Image
    • HUD List Content
      • Prefab Settings
      • List Settings
    • Create Prefab
  • HUD Setup
    • HUD Settings
    • Combatant Settings
    • Display Conditions
    • Unity UI
    • Schematics
  • Shortcut Assignments
    • Default Shortcut Assignment
    • Default Auto Add Slots
  • Save Settings
  • Testing
  • Tip: Control Maps
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!