UNavMovementComponent

NavMovementComponent defines base functionality for MovementComponents that move any 'agent' that may be involved in AI pathfinding.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/NavMovementComponent.h

Include

#include "GameFramework/NavMovementComponent.h"

Syntax

class UNavMovementComponent : public UMovementComponent

Remarks

NavMovementComponent defines base functionality for MovementComponents that move any 'agent' that may be involved in AI pathfinding.

Variables

Name Description

Protected variable

uint8: 1

 

bStopMovementAbortPaths

If set, StopActiveMovement call will abort current path following request

Protected variable

uint8: 1

 

bUpdateNavAgentWithOwnersCollision

If set to true NavAgentProps' radius and height will be updated with Owner's collision capsule size

Protected variable

uint8: 1

 

bUseAccelerationForPaths

If set, pathfollowing will control character movement via acceleration values.

Protected variable

uint8: 1

 

bUseFixedBrakingDistanceForPaths

If set, FixedPathBrakingDistance will be used for path following deceleration

Protected variable

float

 

FixedPathBrakingDistance

Braking distance override used with acceleration driven path following (bUseAccelerationForPaths)

Public variable

FMovementProper...

 

MovementState

Expresses runtime state of character's movement.

Public variable

FNavAgentProper...

 

NavAgentProps

Properties that define how the component can move.

Constructors

Name Description

Public function

UNavMovementComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const

bool

 

CanEverCrouch()

Returns true if component can crouch

Public function Const

bool

 

CanEverFly()

Returns true if component can fly

Public function Const

bool

 

CanEverJump()

Returns true if component can jump

Public function Const

bool

 

CanEverMoveOnGround()

Returns true if component can move along the ground (walk, drive, etc)

Public function Const

bool

 

CanEverSwim()

Returns true if component can swim

Public function Virtual Const

bool

 

CanStartPathFollowing()

Returns true if path following can start

Public function Virtual Const

bool

 

CanStopPathFollowing()

Check if current move target can be reached right now if positions are matching (e.g. performing scripted move and can't stop)

Public function

void

 

ClearFixedBrakingDistance()

Clears fixed braking distance

Public function Const

FVector

 

GetActorFeetLocation()

Returns location of controlled actor's "feet" meaning center of bottom of collision bounding box

Public function Virtual Const

FBasedPositi...

 

GetActorFeetLocationBased()

Returns based location of controlled actor

Public function Const

FVector

 

GetActorLocation()

Returns location of controlled actor - meaning center of collision bounding box

Public function Const

FVector

 

GetActorNavLocation()

Returns navigation location of controlled actor

Public function

FNavAgentPro...

 

GetNavAgentPropertiesRef()

Returns the NavAgentProps

Public function Const

const FNavAg...

 

GetNavAgentPropertiesRef()

Returns the NavAgentProps(const)

Public function Const

const IPathF...

 

GetPathFollowingAgent()

Public function

IPathFollowi...

 

GetPathFollowingAgent()

Public function Virtual Const

float

 

GetPathFollowingBrakingDistance

(
    float MaxSpeed
)

Returns braking distance for acceleration driven path following

Public function Virtual Const

bool

 

IsCrouching()

Returns true if currently crouching

Public function Virtual Const

bool

 

IsFalling()

Returns true if currently falling (not flying, in a non-fluid volume, and not on the ground)

Public function Virtual Const

bool

 

IsFlying()

Returns true if currently flying (moving through a non-fluid volume without resting on the ground)

Public function Const

bool

 

IsJumpAllowed()

Returns true if component is allowed to jump

Public function Virtual Const

bool

 

IsMovingOnGround()

Returns true if currently moving on the ground (e.g. walking or driving)

Public function Virtual Const

bool

 

IsSwimming()

Returns true if currently swimming (moving through a fluid volume)

Public function Virtual

void

 

RequestDirectMove

(
    const FVector& MoveVelocity,
    bool bForceMaxSpeed
)

Path following: request new velocity

Public function Virtual

void

 

RequestPathMove

(
    const FVector& MoveInput
)

Path following: request new move input (normal vector = full strength)

Public function

void

 

ResetMoveState()

Resets runtime movement state to character's movement capabilities

Public function

void

 

SetFixedBrakingDistance

(
    float DistanceToEndOfPath
)

Set fixed braking distance

Public function

void

 

SetJumpAllowed

(
    bool bAllowed
)

Sets whether this component is allowed to jump

Public function

void

 

SetPathFollowingAgent

Public function

void

 

SetUpdateNavAgentWithOwnersCollisions

(
    bool bUpdateWithOwner
)

Public function Const

bool

 

ShouldUpdateNavAgentWithOwnersCollision()

Public function Virtual

void

 

StopActiveMovement()

Stops applying further movement (usually zeros acceleration).

Public function

void

 

StopMovementKeepPathing()

Stops movement immediately (reset velocity) but keeps following current path

Public function

void

 

UpdateNavAgent

(
    const AActor& InOwner
)

Public function

void

 

UpdateNavAgent

(
    const UCapsuleComponent& CapsuleCo...
)

Public function Const

bool

 

UseAccelerationForPathFollowing()

Overridden from UMovementComponent

Name Description

Public function Virtual

void

 

StopMovementImmediately()

Overridden to also call StopActiveMovement().

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss