Skip to content
Pablo Rodriguez

Gameplay Systems And Ui Connection

Creating a reusable actor for modifying character statistics throughout the game world.

File Organization:

  • Create Actors folder → Statistic_Modify subfolder
  • Create Actor_Statistic_Modify blueprint

Component Structure:

  1. Sphere (base component, no collision, visual placeholder)
  2. Box_Collision (100x100x100 extent)
  3. Sphere_Collision (radius 100)
  4. Capsule_Collision (height 88, radius 64)

Shape Enumeration: Enumeration_Shape

  • Sphere, Box, Capsule

Shape Variable System:

  • Shape (Enumeration_Shape, Instance Editable)
  • Math (Enumeration_Math for Add/Subtract)
  • Value (Float for modification amount)

Construction Script Logic: Based on Shape variable:

  • Set Visibility: Show selected shape, hide others
  • Set Collision Enabled: Enable selected shape collision, disable others
  • Collision Preset: Custom → Enable Pawn Overlap only

Dynamic Event Binding: Use Switch node off Shape variable:

  • Each shape: Bind Event to On Component Begin Overlap
  • All shapes use same function: F_Modify_Health
  • Centralizes overlap logic while maintaining shape flexibility

F_Modify_Health Function:

Other Actor → Interface_Health_Modify (Value, Math)

Simple interface call that works with any character implementing the health modification interface.

Damage Actor: Subtract 100 health Healing Actor: Add 100 health Collectibles: Various positive values Traps: Various negative values

This actor becomes the foundation for power-ups, traps, collectibles, coins, and other statistic-modifying elements throughout game prototyping.

UI widgets that display character information above their heads.

File Structure:

  • Create W_Nameplate folder and widget
  • Create Interface_Widget_Nameplate

Component Setup:

  • CanvasPanel_Body and CanvasPanel_Div (240x75 size)
  • ProgressBar_Template_Health (scaled to 0.75, health template)
  • Text_Label (font size 10, top middle anchor)

Interface Function:

  • Interface_Label_Update (Text input)
  • Updates nameplate text through interface calls

Master Character Setup:

  • Add Widget_Nameplate component to character
  • Widget Settings:
    • Widget Class: W_Nameplate
    • Space: Screen
    • Draw at Desired Size: Enabled
    • Pivot X/Y: 0.5
    • Z Location: 120

Character Name System:

  • Add Character_Name variable (Text, Instance Editable)
  • On Event Begin Play: Update nameplate label through interface

Health Integration:

  • Override F_Health_Modify in characters
  • Cast widget to W_Nameplate → Get Health Progress Bar → Update Current
  • Widget Setup: Set Min/Max values and initial current value
  • Add 0.2 second delay for proper widget initialization

Player Character:

  • Hide own nameplate: Is Locally ControlledSet Hidden in Game
  • Player doesn’t need to see their own nameplate

AI Character:

  • Always show nameplate for enemy identification
  • Same health update system as player
  • Different default character names (e.g., “Enemy 001”)

Sphere Trace Attack:

Get Actor Location + Forward Vector * 600 → Sphere Trace for Objects

Trace Configuration:

  • Radius: 40
  • Object Types: Pawn (promote to Attack_Trace variable)
  • Draw Debug: For Duration (testing)
  • Ignore Self: Checked

Damage Application:

Hit Actor → Interface_Health_Modify (Value: damage amount, Math: Subtract)

Child Blueprint: BP_Character_Coursera_AI

  • Disable CameraBoom and FollowCamera (Auto Activate off)
  • Set nameplate widget and positioning
  • Use Mixamo Xbox model and animations
  • Configure default health values

Nameplate Updates:

  • Same override system as player character
  • Implement F_Health_Modify with widget casting and interface calls
  • Set default Character_Name in Class Defaults

W_Ability Widget:

  • Canvas panels + Icon template
  • Basic icon display with default settings

W_Ability_Bar Widget:

  • Canvas panels (400x200 div size)
  • Contains W_Ability template
  • Positioned above resource bar in root widget

Player Controller Setup: G key toggle system using Flip Flop:

  • First Press: Set Input Mode Game and UI + Show Mouse Cursor
  • Second Press: Set Input Mode Game Only + Hide Mouse Cursor

This allows switching between gameplay and UI interaction modes for testing.

Player Character Interface: Interface_Character_Player

  • Interface_Use_Ability function
  • Implement on Player Character to call existing attack code

Button Binding:

W_Ability → Get W_Icon → Get Button → Bind Event to On Released

Event Implementation:

Get Player Pawn → Interface_Use_Ability

This creates clickable ability buttons that trigger the same attack functionality as keyboard input, demonstrating UI-to-gameplay integration.

The combat system provides immediate visual feedback through nameplate health updates and creates foundation for more complex combat mechanics in future development.