Skip to content
Pablo Rodriguez

Platformer Attack System

Platformer games require a special attack mechanic where players can damage enemies by jumping on them. This creates unique combat flow where aerial positioning becomes a tactical element.

Add collision detection for jump attacks on AI characters:

  • Component: Box Collision named “Jump_Hit”
  • Position: Above enemy character head (Z location ~90)
  • Scale: Z scale 0.25 for thin detection zone
  • Collision Settings: Custom collision, ignore all, overlap pawn only
// Jump Hit Begin Overlap Event
OnJumpHitBeginOverlap(OtherActor) {
if (character_is_falling && player_z_location > enemy_z_location) {
deal_damage_to_enemy;
play_player_jump_animation;
launch_player_upward;
}
}

Create interface function for jump attack response:

  • Function: Interface_Jump_Hit_Montage
  • Purpose: Plays backflip animation when jump attack succeeds
  • Animation: Backflip montage with rate scale 2.0 for snappy feel

Implement multiple checks to prevent accidental triggers:

  • Falling Check: Verify player character is falling (not walking/running)
  • Position Check: Confirm player is above enemy (Z location comparison)
  • Velocity Check: Ensure player has negative Z velocity (falling downward)
// Validation sequence
if (other_actor.is_player) {
if (character_movement.is_falling) {
if (player_z_location > enemy_z_location) {
if (player_z_velocity < 0) {
execute_jump_attack;
}
}
}
}

Configure backflip animation for jump attacks:

  • Animation: Backflip animation with feet landing in same position
  • Import: Standard X Bot skeleton import process
  • Montage: Create animation montage for gameplay integration

Create animation sections for precise control:

  • Jump_Start: Beginning of backflip motion
  • Jump_End: Landing portion of animation
  • Section Separation: Use “Clear” button to separate sections
  • Starting Section: Set to “Jump_Start” for partial animation play
  • Rate Scale: 1.0 for proper timing (adjust from initial 2.0 testing value)
  • Animation Slot: Full Body animation slot for complete character animation
  • Interruption: Allow other animations to interrupt for fluid gameplay

Provide upward momentum after successful jump attack:

  • Launch Strength: Z value 1200 units for satisfying bounce
  • Override Z: Enable to ensure consistent upward launch
  • Directional Launch: Purely vertical launch prevents unwanted horizontal movement

Jump attacks deal damage to enemies through existing health system:

  • Damage Amount: Configurable damage value (typically moderate damage)
  • Health Interface: Use existing Interface_Health_Modify system
  • Damage Type: Subtract method for damage application

Add hit reaction for visual feedback:

  • Hit React Animation: “Hit React Behind” animation from Mixamo
  • Enemy Montage: Create montage for enemy hit response
  • Timing: Play after damage calculation completes

Create toggle system for platformer-specific mechanics:

  • Platformer Boolean: Enable/disable platformer mechanics per character
  • Default State: Set to true for platformer enemies, false for others
  • Collision Control: Disable jump hit collision when platformer mode off

Design system to work alongside other game modes:

  • Conditional Activation: Only active when platformer variable enabled
  • Mode Switching: Characters can be configured for different game modes
  • Collision Management: Proper collision state management based on mode

The platformer attack system adds unique aerial combat mechanics while maintaining compatibility with other game modes through conditional activation.