Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/Character.h |
Include |
#include "GameFramework/Character.h" |
class ACharacter : public APawn
Characters are Pawns that have a mesh, collision, and built-in movement logic. They are responsible for all physical interaction between the player or AI and the world, and also implement basic networking and input models. They are designed for a vertically-oriented player representation that can walk, jump, fly, and swim through the world using CharacterMovementComponent.
Name | Description | ||
---|---|---|---|
|
float |
AnimRootMotionTranslationScale |
Scale to apply to root motion translation on this Character |
|
BasedMovement |
Info about our current movement base (object we are standing on). |
|
|
FQuat |
BaseRotationOffset |
Saved rotation offset of mesh. |
|
FVector |
BaseTranslationOffset |
Saved translation offset of mesh. |
|
uint32: 1 |
bClientCheckEncroachmentOnNetUpdate |
|
|
uint32: 1 |
bClientResimulateRootMotion |
If server disagrees with root motion track position, client has to resimulate root motion from last AckedMove. |
|
uint32: 1 |
bClientResimulateRootMotionSources |
If server disagrees with root motion state, client has to resimulate root motion from last AckedMove. |
|
uint32: 1 |
bClientUpdating |
When true, applying updates to network client (replaying saved moves for a locally controlled character) |
|
uint32: 1 |
bClientWasFalling |
True if Pawn was initially falling when started to replay network moves. |
|
bool |
bInBaseReplication |
Flag that we are receiving replication of the based movement. |
|
uint32: 1 |
bIsCrouched |
Set by character movement to specify that this Character is currently crouched. |
|
uint32: 1 |
bPressedJump |
When true, player wants to jump |
|
uint32: 1 |
bProxyIsJumpForceApplied |
Set to indicate that this Character is currently under the force of a jump (if JumpMaxHoldTime is non-zero). |
|
uint32: 1 |
bServerMoveIgnoreRootMotion |
Disable root motion on the server. |
|
uint32: 1 |
bSimGravityDisabled |
Disable simulated gravity (set when character encroaches geometry on client, to keep it from falling through floors) |
|
uint32: 1 |
bWasJumping |
Tracks whether or not the character was already jumping last frame. |
|
ClientRootMotionParams |
For LocallyControlled Autonomous clients. Saved root motion data to be used by SavedMoves. |
|
|
float |
CrouchedEyeHeight |
Default crouched eye height |
|
int32 |
JumpCurrentCount |
Tracks the current number of jumps performed. |
|
int32 |
JumpCurrentCountPreJump |
Represents the current number of jumps performed before CheckJumpInput modifies JumpCurrentCount. |
|
float |
JumpForceTimeRemaining |
Amount of jump force time remaining, if JumpMaxHoldTime > 0. |
|
float |
JumpKeyHoldTime |
Jump key Held Time. This is the time that the player has held the jump key, in seconds. |
|
int32 |
JumpMaxCount |
The max number of jumps the character can perform. |
|
float |
JumpMaxHoldTime |
The max time the jump key can be held. |
|
LandedDelegate |
Called upon landing when falling, to perform actions based on the Hit result. |
|
|
MovementModeChangedDelegate |
Multicast delegate for MovementMode changing. |
|
|
uint32 |
NumActorOverlapEventsCounter |
Incremented every time there is an Actor overlap event (start or stop) on this actor. |
|
OnCharacterMovementUpdated |
Event triggered at the end of a CharacterMovementComponent movement update. |
|
|
OnReachedJumpApex |
Broadcast when Character's jump reaches its apex. Needs CharacterMovement->bNotifyApex = true |
|
|
FVector_NetQuan... |
PreNetReceivedGravityDirection |
Cached version of the replicated gravity direction before replication. |
|
float |
ProxyJumpForceStartedTime |
Track last time a jump force started for a proxy. |
|
float |
ReplayLastTransformUpdateTimeStamp |
|
|
ReplicatedBasedMovement |
Replicated version of relative movement. Read-only on simulated proxies! |
|
|
FVector_NetQuan... |
ReplicatedGravityDirection |
CharacterMovement Custom gravity direction replicated for simulated proxies. |
|
uint8 |
ReplicatedMovementMode |
CharacterMovement MovementMode (and custom mode) replicated for simulated proxies. |
|
float |
ReplicatedServerLastTransformUpdateTimeStamp |
CharacterMovement ServerLastTransformUpdateTimeStamp value, replicated to simulated proxies. |
|
RepRootMotion |
Replicated Root Motion montage |
|
|
RootMotionRepMoves |
Array of previously received root motion moves from the server. |
|
|
SavedRootMotion |
For LocallyControlled Autonomous clients. |
Name | Description | |
---|---|---|
|
ACharacter ( |
Default UObject constructor. |
Name | Description | ||
---|---|---|---|
|
void |
ApplyAsyncOutput ( |
|
|
void |
ApplyDamageMomentum ( |
Apply momentum caused by damage. |
|
void |
BaseChange() |
Event called after actor's base changes (if SetBase was requested to notify us with bNotifyPawn). |
|
void |
CacheInitialMeshOffset ( |
Cache mesh offset from capsule. |
|
bool |
CanCrouch() |
|
|
bool |
CanJump() |
Check if the character can jump in the current state. |
|
bool |
CanJumpInternal() |
Customizable event to check if the character can jump in the current state. |
|
bool |
CanJumpInternal_Implementation() |
Customizable event to check if the character can jump in the current state. |
|
bool |
CanUseRootMotionRepMove ( |
True if buffered move is usable to teleport client back to. |
|
void |
CheckJumpInput ( |
Trigger jump if jump button has been pressed. |
|
void |
ClearJumpInput ( |
Update jump input state after having checked input. |
|
void |
ClientAckGoodMove ( |
If no client adjustment is needed after processing received ServerMove(), ack the good move so client can remove it from SavedMoves |
|
void |
ClientAckGoodMove_Implementation ( |
If no client adjustment is needed after processing received ServerMove(), ack the good move so client can remove it from SavedMoves |
|
void |
ClientAdjustPosition ( |
Replicate position correction to client, associated with a timestamped servermove. |
|
void |
ClientAdjustPosition_Implementation ( |
Replicate position correction to client, associated with a timestamped servermove. |
|
void |
ClientAdjustRootMotionPosition ( |
Replicate position correction to client when using root motion for movement. |
|
void |
ClientAdjustRootMotionPosition_Implementation ( |
Replicate position correction to client when using root motion for movement. |
|
void |
ClientAdjustRootMotionSourcePosition ( |
Replicate root motion source correction to client when using root motion for movement. |
|
void |
ClientAdjustRootMotionSourcePosition_Implementation ( |
Replicate root motion source correction to client when using root motion for movement. |
|
void |
ClientCheatFly() |
|
|
void |
ClientCheatFly_Implementation() |
|
|
void |
ClientCheatGhost() |
|
|
void |
ClientCheatGhost_Implementation() |
|
|
void |
ClientCheatWalk() |
|
|
void |
ClientCheatWalk_Implementation() |
|
|
void |
ClientMoveResponsePacked ( |
Client RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
void |
ClientMoveResponsePacked_Implementation ( |
Client RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
bool |
ClientMoveResponsePacked_Validate ( |
Client RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
void |
ClientVeryShortAdjustPosition ( |
Bandwidth saving version, when velocity is zeroed |
|
void |
ClientVeryShortAdjustPosition_Implementation ( |
Bandwidth saving version, when velocity is zeroed |
|
void |
Crouch ( |
Request the character to start crouching. |
|
void |
Falling() |
Called when the character's movement enters falling |
|
void |
FillAsyncInput ( |
Async simulation API |
|
T * |
FindComponentByClass() |
|
|
int32 |
FindRootMotionRepMove ( |
Find usable root motion replicated move from our buffer. |
|
float |
GetAnimRootMotionTranslationScale() |
Returns current value of AnimRootMotionScale |
|
UArrowCompon... |
GetArrowComponent() |
Returns ArrowComponent subobject |
|
const FBased... |
GetBasedMovement() |
Accessor for BasedMovement |
|
FQuat |
GetBaseRotationOffset() |
Get the saved rotation offset of mesh. |
|
FRotator |
GetBaseRotationOffsetRotator() |
Get the saved rotation offset of mesh. |
|
FVector |
GetBaseTranslationOffset() |
Get the saved translation offset of mesh. |
|
UCapsuleComp... |
GetCapsuleComponent() |
Returns CapsuleComponent subobject |
|
T * |
GetCharacterMovement() |
Returns CharacterMovement subobject |
|
UCharacterMo... |
GetCharacterMovement() |
|
|
UAnimMontage... |
GetCurrentMontage() |
Return current playing Montage |
|
float |
GetJumpMaxHoldTime() |
Get the maximum jump time for the character. |
|
USkeletalMes... |
GetMesh() |
END DEPRECATED RPCs. |
|
const FBased... |
GetReplicatedBasedMovement() |
Accessor for ReplicatedBasedMovement |
|
FVector |
GetReplicatedGravityDirection() |
Returns replicated gravity direction for simulated proxies |
|
uint8 |
GetReplicatedMovementMode() |
Returns ReplicatedMovementMode |
|
float |
GetReplicatedServerLastTransformUpdateTimeStamp() |
Accessor for ReplicatedServerLastTransformUpdateTimeStamp. |
|
FAnimMontage... |
GetRootMotionAnimMontageInstance() |
Get FAnimMontageInstance playing RootMotion |
|
bool |
HasAnyRootMotion() |
True if we are playing root motion from any source right now (anim root motion, root motion source) |
|
void |
InitializeAsyncOutput ( |
|
|
bool |
IsJumpProvidingForce() |
True if jump is actively providing a force, such as when the jump key is held and the time it has been held is less than JumpMaxHoldTime. |
|
bool |
IsPlayingNetworkedRootMotionMontage() |
True if we are playing Root Motion right now, through a Montage with RootMotionMode == ERootMotionMode::RootMotionFromMontagesOnly. |
|
bool |
IsPlayingRootMotion() |
True if we are playing Anim root motion right now |
|
void |
Jump() |
Make the character jump on the next update. |
|
bool |
JumpIsAllowedInternal() |
|
|
void |
K2_OnEndCrouch ( |
Event when Character stops crouching. |
|
void |
K2_OnMovementModeChanged ( |
Called from CharacterMovementComponent to notify the character that the movement mode has changed. |
|
void |
K2_OnStartCrouch ( |
Event when Character crouches. |
|
void |
K2_UpdateCustomMovement ( |
Event for implementing custom character movement mode. |
|
void |
Landed ( |
Called upon landing when falling, to perform actions based on the Hit result. |
|
void |
LaunchCharacter ( |
Set a pending launch velocity on the Character. |
|
void |
MoveBlockedBy ( |
Called when pawn's movement is blocked |
|
void |
NotifyJumpApex() |
Called when character's jump reaches Apex. Needs CharacterMovement->bNotifyApex = true |
|
void |
OnEndCrouch ( |
Called when Character stops crouching. |
|
void |
OnJumped() |
Event fired when the character has just started jumping |
|
void |
OnJumped_Implementation() |
Event fired when the character has just started jumping |
|
void |
OnLanded ( |
Called upon landing when falling, to perform actions based on the Hit result. |
|
void |
OnLaunched ( |
Let blueprint know that we were launched |
|
void |
OnMovementModeChanged ( |
Called from CharacterMovementComponent to notify the character that the movement mode has changed. |
|
void |
OnRep_IsCrouched() |
Handle Crouching replicated from server |
|
void |
OnRep_ReplayLastTransformUpdateTimeStamp() |
|
|
void |
OnRep_ReplicatedBasedMovement() |
Rep notify for ReplicatedBasedMovement |
|
void |
OnRep_RootMotion() |
Handles replicated root motion properties on simulated proxies and position correction. |
|
void |
OnStartCrouch ( |
Called when Character crouches. Called on non-owned Characters through bIsCrouched replication. |
|
void |
OnUpdateSimulatedPosition ( |
Called on client after position update is received to respond to the new location and rotation. |
|
void |
OnWalkingOffLedge ( |
Event fired when the Character is walking off a surface and is about to fall because CharacterMovement->CurrentFloor became unwalkable. |
|
void |
OnWalkingOffLedge_Implementation ( |
Event fired when the Character is walking off a surface and is about to fall because CharacterMovement->CurrentFloor became unwalkable. |
|
float |
PlayAnimMontage ( |
Play Animation Montage on the character mesh. |
|
void |
RecalculateCrouchedEyeHeight() |
Calculates the crouched eye height based on movement component settings |
|
void |
ResetJumpState() |
Marks character as not trying to jump |
|
bool |
RestoreReplicatedMove ( |
Restore actor to an old buffered move. |
|
void |
RootMotionDebugClientPrintOnScreen ( |
|
|
void |
RootMotionDebugClientPrintOnScreen_Implementation ( |
|
|
void |
SaveRelativeBasedMovement ( |
Save a new relative location in BasedMovement and a new rotation with is either relative or absolute. |
|
void |
ServerMove ( |
BEGIN DEPRECATED RPCs that don't use variable sized payloads. Use ServerMovePacked and ClientMoveResponsePacked instead. |
|
void |
ServerMove_Implementation ( |
BEGIN DEPRECATED RPCs that don't use variable sized payloads. Use ServerMovePacked and ClientMoveResponsePacked instead. |
|
bool |
ServerMove_Validate ( |
BEGIN DEPRECATED RPCs that don't use variable sized payloads. Use ServerMovePacked and ClientMoveResponsePacked instead. |
|
void |
ServerMoveDual ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveDual_Implementation ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
bool |
ServerMoveDual_Validate ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveDualHybridRootMotion ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveDualHybridRootMotion_Implementation ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
bool |
ServerMoveDualHybridRootMotion_Validate ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveDualNoBase ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveDualNoBase_Implementation ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
bool |
ServerMoveDualNoBase_Validate ( |
Replicated function sent by client to server - contains client movement and view info for two moves. |
|
void |
ServerMoveNoBase ( |
Replicated function sent by client to server. |
|
void |
ServerMoveNoBase_Implementation ( |
Replicated function sent by client to server. |
|
bool |
ServerMoveNoBase_Validate ( |
Replicated function sent by client to server. |
|
void |
ServerMoveOld ( |
Resending an (important) old move. Process it if not already processed. |
|
void |
ServerMoveOld_Implementation ( |
Resending an (important) old move. Process it if not already processed. |
|
bool |
ServerMoveOld_Validate ( |
Resending an (important) old move. Process it if not already processed. |
|
void |
ServerMovePacked ( |
Server RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
void |
ServerMovePacked_Implementation ( |
Server RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
bool |
ServerMovePacked_Validate ( |
Server RPC that passes through to CharacterMovement (avoids RPC overhead for components). |
|
void |
SetAnimRootMotionTranslationScale ( |
Sets scale to apply to root motion translation on this Character |
|
void |
SetBase ( |
Sets the component the Character is walking on, used by CharacterMovement walking movement to be able to follow dynamic objects. |
|
bool |
ShouldNotifyLanded ( |
Returns true if the Landed() event should be called. |
|
void |
SimulatedRootMotionPositionFixup ( |
Position fix up for Simulated Proxies playing Root Motion |
|
void |
StopAnimMontage ( |
Stop Animation Montage. |
|
void |
StopJumping() |
Stop the character from jumping on the next update. |
|
void |
UnCrouch ( |
Request the character to stop crouching. |
Name | Description | ||
---|---|---|---|
|
void |
DisplayDebug ( |
|
|
float |
GetDefaultHalfHeight() |
Returns The half-height of the default Pawn, scaled by the component scale. |
|
FVector |
GetGravityDirection() |
Returns vector direction of gravity |
|
FQuat |
GetGravityTransform() |
Returns a quaternion transforming from world space into gravity relative space |
|
UPrimitiveCo... |
GetMovementBase() |
Return PrimitiveComponent we are based on (standing on, attached to, and moving on). |
|
UPawnMovemen... |
GetMovementComponent() |
Return our PawnMovementComponent, if we have one. |
|
void |
PawnClientRestart() |
Called on the owning client of a player-controlled Pawn when it is restarted, this calls Restart() |
|
void |
PossessedBy ( |
Called when this Pawn is possessed. Only called on the server (or in standalone). |
|
void |
RecalculateBaseEyeHeight() |
Set BaseEyeHeight based on current state. |
|
void |
Restart() |
Called when the Pawn is being restarted (usually by being possessed by a Controller). |
|
void |
SetupPlayerInputComponent ( |
Allows a Pawn to set up custom input bindings. |
|
void |
TurnOff() |
Freeze pawn - stop sounds, animations, physics, weapon firing |
|
void |
UnPossessed() |
Called when our Controller no longer possesses us. Only called on the server (or in standalone). |
|
void |
UpdateNavigationRelevance() |
Update all components relevant for navigation generators to match bCanAffectNavigationGeneration flag |
Name | Description | ||
---|---|---|---|
|
void |
BeginPlay() |
Overridable native event for when play begins for this actor. |
|
void |
ClearCrossLevelReferences() |
Do anything needed to clear out cross level references; Called from ULevel::PreSave |
|
UActorCompon... |
FindComponentByClass ( |
Searches components array and returns first encountered component of the specified class, native version of GetComponentByClass |
|
void |
GetSimpleCollisionCylinder ( |
Get axis-aligned cylinder around this actor, used for simple collision checks (ie Pawns reaching a destination). |
|
void |
NotifyActorBeginOverlap ( |
Event when this actor overlaps another actor, for example a player walking into a trigger. |
|
void |
NotifyActorEndOverlap ( |
Event when an actor no longer overlaps another actor, and they have separated. |
|
void |
OnRep_ReplicatedMovement() |
ReplicatedMovement struct replication event |
|
void |
PostInitializeComponents() |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |
|
void |
PostNetReceiveLocationAndRotation() |
Update location and rotation from ReplicatedMovement. Not called for simulated physics! |
|
void |
PreReplication ( |
Called on the actor right before replication occurs. |
|
void |
PreReplicationForReplay ( |
Called on the actor right before replication occurs. |
|
void |
SetReplicateMovement ( |
Set whether this actor's movement replicates to network clients. |
|
void |
TornOff() |
Networking - called on client when actor is torn off (bTearOff==true), meaning it's no longer replicated to clients. |
Name | Description | ||
---|---|---|---|
|
void |
GetLifetimeReplicatedProps ( |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native replicated properties |
|
void |
GetReplicatedCustomConditionState ( |
Called when this actor begins replicating to initialize the state of custom property conditions |
|
void |
PostLoad() |
Do any object-specific cleanup required immediately after loading an object. |
|
void |
PostNetReceive() |
Always called immediately after properties are received from the remote. |
|
void |
PreNetReceive() |
Always called immediately before properties are received from the remote. |
Name | Description | ||
---|---|---|---|
|
FVector |
GetNavAgentLocation() |
Basically retrieved pawn's location on navmesh |
Name |
Description |
---|---|
CapsuleComponentName |
Name of the CapsuleComponent. |
CharacterMovementComponentName |
Name of the CharacterMovement component. |
MeshComponentName |
Name of the MeshComponent. |