Skip to content
Pablo Rodriguez

Keybind System

Before implementing complex keybind systems, plan the complete input layout to avoid conflicts and ensure logical organization.

  • Shift: Dodge roll and air dash (context-sensitive)
  • Left Control: Walk/run toggle
  • C: Sprint (with cooldown)
  • Space: Jump and double jump
  • Left Click: Primary attack
  • Right Click: Block or secondary attack
  • Q: Ultimate attack ability
  • E: Strong attack ability
  • X: Stealth toggle
  • F: General interaction key

Design ability bar to match physical keyboard layout for intuitive use:

  • Logical Positioning: Mouse buttons on right side of screen, keyboard keys on left
  • Spatial Consistency: Left click and right click positioned left and right respectively
  • Key Order: E and Q in correct keyboard order, C and X positioned appropriately

Create input actions for each ability:

  • IA_Ability_01: Left click primary attack
  • IA_Ability_02: Right click secondary attack/block
  • IA_Ability_03: E key strong attack
  • IA_Ability_04: Q key ultimate attack
  • IA_Ability_05: C key sprint
  • IA_Ability_06: X key stealth

Configure IMC_Default with all ability mappings:

  • Map each Input Action to appropriate physical input
  • Ensure no conflicting key assignments
  • Test each input responds correctly

Create interface functions for clean ability communication:

  • Interface_Use_Ability_001 through Interface_Use_Ability_006
  • Each interface function corresponds to specific ability slot
  • Allows UI and character code to communicate consistently
// Ability Bar Button Events
OnButton_LeftClick_Released() {
PlayerCharacter.Interface_Use_Ability_001();
}
OnButton_RightClick_Released() {
PlayerCharacter.Interface_Use_Ability_002();
}
// Continue for all 6 abilities...

Organize code using separate event graphs for better management:

  • Event Graph_Abilities: All ability-related code
  • Base Event Graph: Core character functionality
  • Event Graph_Movement: Movement-specific code (if needed)

This organization prevents single graphs from becoming overwhelming.

Replace temporary keybinds with proper Enhanced Input events:

  • Ability 001: Enhanced Input Action event for left click
  • Ability 002: Enhanced Input Action event for right click
  • Continue through all abilities

Use animation stance switching to provide different abilities per weapon:

// Ability Implementation Example
OnAbility001_Started() {
switch(AnimationStance) {
case Unarmed: PlayMontage(MagicAttack01); break;
case Shield: PlayMontage(ShieldAttack01); break;
case TwoHanded: PlayMontage(TwoHandedAttack01); break;
case Rifle: PlayMontage(RifleShot); break;
case Bow: PlayMontage(BowAttack01); break;
case Stealth: PlayMontage(StealthAttack01); break;
}
}

Ensure abilities properly trigger combat state:

  • Add combat state activation to attack abilities (001, 002, 003, 004)
  • Exclude utility abilities (sprint, stealth) from combat state
  • Maintain 5-second combat duration after ability use

Create intuitive ability bar layout:

  • Size: 800 width to accommodate 6 abilities
  • Button Positioning: Centered layout with proper spacing
  • Visual Hierarchy: Primary abilities (left/right click) prominently positioned
  • Scaling: Smaller scale (0.25) for less critical abilities like stealth

Each ability button requires:

  • Visual Feedback: Hover and press states
  • Interface Communication: Calls appropriate Interface_Use_Ability function
  • Cooldown Display: Visual indication when abilities are unavailable
  • Resource Cost Display: Show mana/stamina requirements

Configure each Input Action with proper settings:

  • Trigger Conditions: Use “Started” trigger for immediate response
  • Consumption: Set to consume input to prevent conflicts
  • Modifiers: Apply any needed input modifiers

Update IMC_Default context:

  • Add mappings for all 6 ability actions
  • Configure proper key bindings for each action
  • Test all mappings respond correctly in-game

The keybind system provides the foundation for responsive, intuitive controls that scale across all game modes and ability types.