Show / Hide Table of Contents

Class MovementComponent

MovementComponent is an abstract component class that defines functionality for moving a PrimitiveComponent (our UpdatedComponent) each tick.

Inheritance
System.Object
UObject
ActorComponent
MovementComponent
InterpToMovementComponent
NavMovementComponent
ProjectileMovementComponent
RotatingMovementComponent
Inherited Members
ActorComponent.RegisterComponent()
ActorComponent.UnregisterComponent()
ActorComponent.ReceiveBeginPlay
ActorComponent.ReceiveEndPlay
ActorComponent.ReceiveTick
ActorComponent.Activate(Boolean)
ActorComponent.AddTickPrerequisiteActor(Actor)
ActorComponent.AddTickPrerequisiteComponent(ActorComponent)
ActorComponent.ComponentHasTag(Name)
ActorComponent.Deactivate()
ActorComponent.GetComponentTickInterval()
ActorComponent.GetOwner()
ActorComponent.IsActive()
ActorComponent.IsBeingDestroyed()
ActorComponent.IsComponentTickEnabled()
ActorComponent.K2_DestroyComponent(UObject)
ActorComponent.RemoveTickPrerequisiteActor(Actor)
ActorComponent.RemoveTickPrerequisiteComponent(ActorComponent)
ActorComponent.SetActive(Boolean, Boolean)
ActorComponent.SetAutoActivate(Boolean)
ActorComponent.SetComponentTickEnabled(Boolean)
ActorComponent.SetComponentTickInterval(Single)
ActorComponent.SetIsReplicated(Boolean)
ActorComponent.SetTickableWhenPaused(Boolean)
ActorComponent.SetTickGroup(Byte)
ActorComponent.ToggleActive()
ActorComponent.PrimaryComponentTick
ActorComponent.AssetUserData
ActorComponent.bReplicates
ActorComponent.bNetAddressable
ActorComponent.bAutoActivate
ActorComponent.bIsActive
ActorComponent.bEditableWhenInherited
ActorComponent.bCanEverAffectNavigation
ActorComponent.bIsEditorOnly
ActorComponent.bIsVisualizationComponent
UObject.TransientPackage
UObject.CastTo<T>(UObject)
UObject.CastTo(UObject, Type)
UObject.RemoveObject(UObject)
UObject.MakeObjectArrayField<T>(NativeArray*)
UObject.NotImplemented<T>()
UObject.Construct()
UObject.GetHashCode()
UObject.GetName()
UObject.ToString()
UObject.Name
UObject._None
UObject.None
UObject.ObjPointer
UObject.LoadObjectFromClass(Class, UObject, String, String, LoadFlags, PackageMap, Boolean)
UObject.LoadClass(Class, UObject, String, String, LoadFlags, PackageMap)
UObject.GetPropertyFor<T>(Name)
UObject.ExecuteUbergraph
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class MovementComponent : ActorComponent
Remarks

Base functionality includes:

  • Restricting movement to a plane or axis.
  • Utility functions for special handling of collision results (SlideAlongSurface(), ComputeSlideVector(), TwoWallAdjust()).
  • Utility functions for moving when there may be initial penetration (SafeMoveUpdatedComponent(), ResolvePenetration()).
  • Automatically registering the component tick and finding a component to move on the owning Actor. Normally the root component of the owning actor is moved, however another component may be selected (see SetUpdatedComponent()). During swept (non-teleporting) movement only collision of UpdatedComponent is considered, attached components will teleport to the end location ignoring collision.

Properties

| Improve this Doc View Source

bAutoRegisterPhysicsVolumeUpdates

Declaration
public bool bAutoRegisterPhysicsVolumeUpdates { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bAutoRegisterUpdatedComponent

Declaration
public bool bAutoRegisterUpdatedComponent { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bAutoUpdateTickRegistration

Declaration
public bool bAutoUpdateTickRegistration { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bComponentShouldUpdatePhysicsVolume

Declaration
public bool bComponentShouldUpdatePhysicsVolume { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bConstrainToPlane

Declaration
public bool bConstrainToPlane { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bSnapToPlaneAtStart

Declaration
public bool bSnapToPlaneAtStart { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bTickBeforeOwner

Declaration
public bool bTickBeforeOwner { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bUpdateOnlyIfRendered

Declaration
public bool bUpdateOnlyIfRendered { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

DefaultObject

Get UE4 Default Object for this Class

Declaration
public static MovementComponent DefaultObject { get; }
Property Value
Type Description
MovementComponent
| Improve this Doc View Source

PlaneConstraintNormal

The normal or axis of the plane that constrains movement, if bConstrainToPlane is enabled.

Declaration
public Vector PlaneConstraintNormal { get; }
Property Value
Type Description
Vector
Remarks

If for example you wanted to constrain movement to the X-Z plane (so that Y cannot change), the normal would be set to X=0 Y=1 Z=0. This is recalculated whenever PlaneConstraintAxisSetting changes. It is normalized once the component is registered with the game world. @see bConstrainToPlane, SetPlaneConstraintNormal(), SetPlaneConstraintFromVectors()

| Improve this Doc View Source

PlaneConstraintOrigin

The origin of the plane that constrains movement, if plane constraint is enabled.

Declaration
public Vector PlaneConstraintOrigin { get; }
Property Value
Type Description
Vector
Remarks

This defines the behavior of snapping a position to the plane, such as by SnapUpdatedComponentToPlane(). @see bConstrainToPlane, SetPlaneConstraintOrigin().

| Improve this Doc View Source

StaticClass

Get UE4 Class

Declaration
public static Class StaticClass { get; }
Property Value
Type Description
Class
| Improve this Doc View Source

UpdatedComponent

The component we move and update.

Declaration
public SceneComponent UpdatedComponent { get; }
Property Value
Type Description
SceneComponent
Remarks

If this is null at startup and bAutoRegisterUpdatedComponent is true, the owning Actor's root component will automatically be set as our UpdatedComponent at startup. @see bAutoRegisterUpdatedComponent, SetUpdatedComponent(), UpdatedPrimitive

| Improve this Doc View Source

UpdatedPrimitive

UpdatedComponent, cast as a UPrimitiveComponent. May be invalid if UpdatedComponent was null or not a UPrimitiveComponent.

Declaration
public PrimitiveComponent UpdatedPrimitive { get; }
Property Value
Type Description
PrimitiveComponent
| Improve this Doc View Source

Velocity

Current velocity of updated component.

Declaration
public Vector Velocity { get; set; }
Property Value
Type Description
Vector

Methods

| Improve this Doc View Source

ConstrainDirectionToPlane(Vector)

Constrain a direction vector to the plane constraint, if enabled.

Declaration
public Vector ConstrainDirectionToPlane(Vector Direction)
Parameters
Type Name Description
Vector Direction
Returns
Type Description
Vector
Remarks

@see SetPlaneConstraint

| Improve this Doc View Source

ConstrainLocationToPlane(Vector)

Constrain a position vector to the plane constraint, if enabled.

Declaration
public Vector ConstrainLocationToPlane(Vector Location)
Parameters
Type Name Description
Vector Location
Returns
Type Description
Vector
| Improve this Doc View Source

ConstrainNormalToPlane(Vector)

Constrain a normal vector (of unit length) to the plane constraint, if enabled.

Declaration
public Vector ConstrainNormalToPlane(Vector Normal)
Parameters
Type Name Description
Vector Normal
Returns
Type Description
Vector
| Improve this Doc View Source

GetGravityZ()

@return gravity that affects this component

Declaration
public float GetGravityZ()
Returns
Type Description
System.Single
| Improve this Doc View Source

GetMaxSpeed()

@return Maximum speed of component in current movement mode.

Declaration
public float GetMaxSpeed()
Returns
Type Description
System.Single
| Improve this Doc View Source

GetPhysicsVolume()

@return PhysicsVolume this MovementComponent is using, or the world's default physics volume if none. *

Declaration
public PhysicsVolume GetPhysicsVolume()
Returns
Type Description
PhysicsVolume
| Improve this Doc View Source

GetPlaneConstraintAxisSetting()

Get the plane constraint axis setting.

Declaration
public EPlaneConstraintAxisSetting GetPlaneConstraintAxisSetting()
Returns
Type Description
EPlaneConstraintAxisSetting
| Improve this Doc View Source

GetPlaneConstraintNormal(Vector)

@return The normal of the plane that constrains movement, enforced if the plane constraint is enabled.

Declaration
public void GetPlaneConstraintNormal(Vector ReturnValue)
Parameters
Type Name Description
Vector ReturnValue
| Improve this Doc View Source

GetPlaneConstraintOrigin(Vector)

Get the plane constraint origin.

Declaration
public void GetPlaneConstraintOrigin(Vector ReturnValue)
Parameters
Type Name Description
Vector ReturnValue
Remarks

This defines the behavior of snapping a position to the plane, such as by SnapUpdatedComponentToPlane(). @return The origin of the plane that constrains movement, if the plane constraint is enabled.

| Improve this Doc View Source

IsExceedingMaxSpeed(Single)

Returns true if the current velocity is exceeding the given max speed (usually the result of GetMaxSpeed()), within a small error tolerance.

Declaration
public bool IsExceedingMaxSpeed(float MaxSpeed)
Parameters
Type Name Description
System.Single MaxSpeed
Returns
Type Description
System.Boolean
Remarks

Note that under normal circumstances updates cause by acceleration will not cause this to be true, however external forces or changes in the max speed limit can cause the max speed to be violated.

| Improve this Doc View Source

K2_GetMaxSpeedModifier()

@return a scalar applied to the maximum velocity that the component can currently move.

Declaration
public float K2_GetMaxSpeedModifier()
Returns
Type Description
System.Single
| Improve this Doc View Source

K2_GetModifiedMaxSpeed()

@return the result of GetMaxSpeed() * GetMaxSpeedModifier().

Declaration
public float K2_GetModifiedMaxSpeed()
Returns
Type Description
System.Single
| Improve this Doc View Source

K2_MoveUpdatedComponent(Vector, Rotator, Boolean, Boolean)

Moves our UpdatedComponent by the given Delta, and sets rotation to NewRotation.

Declaration
public (HitResult, bool) K2_MoveUpdatedComponent(Vector Delta, Rotator NewRotation, bool bSweep, bool bTeleport)
Parameters
Type Name Description
Vector Delta
Rotator NewRotation
System.Boolean bSweep
System.Boolean bTeleport
Returns
Type Description
System.ValueTuple<HitResult, System.Boolean>
Remarks

Respects the plane constraint, if enabled. @return True if some movement occurred, false if no movement occurred. Result of any impact will be stored in OutHit.

| Improve this Doc View Source

New(UObject, Name)

Spawn an object of this class

Declaration
public static MovementComponent New(UObject obj = null, Name name = default(Name))
Parameters
Type Name Description
UObject obj
Name name
Returns
Type Description
MovementComponent
| Improve this Doc View Source

SetPlaneConstraintAxisSetting(EPlaneConstraintAxisSetting)

Set the plane constraint axis setting.

Declaration
public void SetPlaneConstraintAxisSetting(EPlaneConstraintAxisSetting NewAxisSetting)
Parameters
Type Name Description
EPlaneConstraintAxisSetting NewAxisSetting
Remarks

Changing this setting will modify the current value of PlaneConstraintNormal.

@param NewAxisSetting New plane constraint axis setting.

| Improve this Doc View Source

SetPlaneConstraintEnabled(Boolean)

Sets whether or not the plane constraint is enabled.

Declaration
public void SetPlaneConstraintEnabled(bool bEnabled)
Parameters
Type Name Description
System.Boolean bEnabled
| Improve this Doc View Source

SetPlaneConstraintFromVectors(Vector, Vector)

Uses the Forward and Up vectors to compute the plane that constrains movement, enforced if the plane constraint is enabled.

Declaration
public void SetPlaneConstraintFromVectors(Vector Forward, Vector Up)
Parameters
Type Name Description
Vector Forward
Vector Up
| Improve this Doc View Source

SetPlaneConstraintNormal(Vector)

Sets the normal of the plane that constrains movement, enforced if the plane constraint is enabled.

Declaration
public void SetPlaneConstraintNormal(Vector PlaneNormal)
Parameters
Type Name Description
Vector PlaneNormal
Remarks

Changing the normal automatically sets PlaneConstraintAxisSetting to "Custom".

@param PlaneNormal The normal of the plane. If non-zero in length, it will be normalized.

| Improve this Doc View Source

SetPlaneConstraintOrigin(Vector)

Sets the origin of the plane that constrains movement, enforced if the plane constraint is enabled.

Declaration
public void SetPlaneConstraintOrigin(Vector PlaneOrigin)
Parameters
Type Name Description
Vector PlaneOrigin
| Improve this Doc View Source

SetUpdatedComponent(SceneComponent)

Assign the component we move and update.

Declaration
public void SetUpdatedComponent(SceneComponent NewUpdatedComponent)
Parameters
Type Name Description
SceneComponent NewUpdatedComponent
| Improve this Doc View Source

SnapUpdatedComponentToPlane()

Snap the updated component to the plane constraint, if enabled.

Declaration
public void SnapUpdatedComponentToPlane()
| Improve this Doc View Source

StopMovementImmediately()

Stops movement immediately (zeroes velocity, usually zeros acceleration for components with acceleration).

Declaration
public void StopMovementImmediately()

Operators

| Improve this Doc View Source

Implicit(IntPtr to MovementComponent)

Convert from IntPtr to UObject

Declaration
public static implicit operator MovementComponent(IntPtr p)
Parameters
Type Name Description
System.IntPtr p
Returns
Type Description
MovementComponent
  • Improve this Doc
  • View Source
Back to top Generated by DocFX