FMockAbilityInputCmd

Mock Ability Simulation This is meant to illustrate how a higher level simulation can build off an existing one.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FFlyingMovementInputCmd

FMockAbilityInputCmd

References

Module

NetworkPredictionExtras

Header

/Engine/Plugins/Runtime/NetworkPredictionExtras/Source/NetworkPredictionExtras/Public/MockAbilitySimulation.h

Include

#include "MockAbilitySimulation.h"

Syntax

struct FMockAbilityInputCmd : public FFlyingMovementInputCmd

Remarks

Mock Ability Simulation This is meant to illustrate how a higher level simulation can build off an existing one. While something like GameplayAbilities is more generic and data driven, this illustrates how it will need to solve core issues.

This implements:

Stamina "attribute": basic attribute with max + regen value that is consumed by abilities.

Sprint: Increased max speed while sprint button is held. Drains stamina each frame.

Dash: Immediate acceleration to a high speed for X seconds.

Blink: Teleport to location X units ahead

MockAbility Data structures

Variables

Name Description

Public variable

bool

 

bBlinkPressed

Public variable

bool

 

bDashPressed

Public variable

bool

 

bPrimaryPressed

Public variable

bool

 

bSecondaryPressed

Public variable

bool

 

bSprintPressed

Functions

Name Description

Public function

void

 

NetSerialize

(
    const FNetSerializeParams& P
)

Public function Const

void

 

ToString

(
    FAnsiStringBuilderBase& Out
)