Navigation
API > API/Plugins > API/Plugins/Mover
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UMoverComponent
- UCharacterMoverComponent
References
| Module | Mover |
| Header | /Engine/Plugins/Experimental/Mover/Source/Mover/Public/MoverComponent.h |
| Include | #include "MoverComponent.h" |
Syntax
UCLASS (BlueprintType, Meta=(BlueprintSpawnableComponent))
class UMoverComponent : public UActorComponent
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSubclassOf< UActorComponent > | BackendClass | Specifies which supporting back end class should drive this Mover actor. | |
| TWeakInterfacePtr< IMoverBackendLiaisonInterface > | BackendLiaisonComp | ||
| FMoverDynamicBasedMovementTickFunction | BasedMovementTickFunction | Tick function that may be called anytime after this actor's movement step, useful as a way to support based movement on objects that are not | |
| bool | bHasValidCachedState | ||
| bool | bHasValidCachedUsedInput | ||
| bool | bHasValidLastProducedInput | ||
| FMoverAuxStateContext | CachedLastAuxState | ||
| FMoverInputCmdContext | CachedLastProducedInputCmd | ||
| FMoverTimeStep | CachedLastSimTickTimeStep | ||
| FMoverSyncState | CachedLastSyncState | ||
| FMoverInputCmdContext | CachedLastUsedInputCmd | ||
| FMoverTimeStep | CachedNewestSimTickTimeStep | ||
| TObjectPtr< UObject > | InputProducer | Optional object for producing input cmds. | |
| TObjectPtr< UPrimitiveComponent > | MovementBaseDependency | ||
| TObjectPtr< UMovementMixer > | MovementMixer | Optional object for mixing proposed moves.Typically set at BeginPlay time. | |
| TMap< FName, TObjectPtr< UBaseMovementMode > > | MovementModes | ||
| FMover_OnMovementModeChanged | OnMovementModeChanged | Broadcast when a MovementMode has changed. Happens during a simulation tick if the mode changed that tick or when SetModeImmediately is used to change modes. | |
| FMover_OnPostMovement | OnPostMovement | Broadcast at the end of a simulation tick after movement has occurred, but allowing additions/modifications to the state. Not assignable as a BP event due to it having mutable parameters. | |
| FMover_OnPostSimRollback | OnPostSimulationRollback | Broadcast when a rollback has occurred, just before the next simulation tick occurs. | |
| FMover_OnPostSimTick | OnPostSimulationTick | Broadcast after each simulation tick and the state is finalized. | |
| FMover_OnPreSimTick | OnPreSimulationTick | Broadcast before each simulation tick. | |
| TArray< FMoverDataPersistence > | PersistentSyncStateDataTypes | List of types that should always be present in this actor's sync state | |
| TObjectPtr< USceneComponent > | PrimaryVisualComponent | The main visual component associated with this Mover actor, typically a mesh and typically parented to the UpdatedComponent. | |
| FName | StartingMovementMode | Name of the first mode to start in when simulation begins. Must have a mapping in MovementModes. Only used during initialization. | |
| TArray< TObjectPtr< UBaseMovementModeTransition > > | Transitions | Transition checks that are always evaluated regardless of mode. Evaluated in order, stopping at the first successful transition check. Mode-owned transitions take precedence. */. | |
| TObjectPtr< UPrimitiveComponent > | UpdatedCompAsPrimitive | UpdatedComponent, cast as a UPrimitiveComponent. | |
| TObjectPtr< USceneComponent > | UpdatedComponent | This is the component that's actually being moved. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| UBaseMovementMode * | AddMovementModeFromClass
(
FName ModeName, |
Add a movement mode to available movement modes. Returns true if the movement mode was added successfully. Returns the mode that was made. | |
| bool | AddMovementModeFromObject
(
FName ModeName, |
Add a movement mode to available movement modes. Returns true if the movement mode was added successfully. | |
| void | FinalizeFrame
(
const FMoverSyncState* SyncState, |
Take output for simulation. Called by Network Prediction system. | |
| const FLayeredMoveBase * | FindActiveLayeredMoveByType
(
const UScriptStruct* DataStructType |
Find an active layered move by type. Returns null if one wasn't found. | |
| const T * | Find a layered move of a specific type in this components active layered moves. | ||
| UBaseMovementMode * | FindMode_Mutable
(
const UClass* ByType, |
Find movement mode by type. Returns null if there is none of that type | |
| T * | FindMode_Mutable
(
bool bRequireExactClass |
||
| UBaseMovementMode * | FindMovementMode
(
TSubclassOf< UBaseMovementMode > MovementMode |
||
| const T * | |||
| const IMovementSettingsInterface * | FindSharedSettings
(
const UClass* ByType |
Find settings object by type. Returns null if there is none of that type | |
| const UObject * | FindSharedSettings_BP
(
UPARAM(meta=(MustImplement="MovementSettingsInterface")) TSubclassOf< UObject > SharedSetting |
Find settings object by type. Returns null if there is none of that type | |
| IMovementSettingsInterface * | FindSharedSettings_Mutable
(
const UClass* ByType |
Find mutable settings object by type. Returns null if there is none of that type | |
| T * | |||
| UObject * | FindSharedSettings_Mutable_BP
(
UPARAM(meta=(MustImplement="MovementSettingsInterface")) TSubclassOf< UObject > SharedSetting |
Find mutable settings object by type. Returns null if there is none of that type | |
| TArray< FTrajectorySampleInfo > | GetFutureTrajectory
(
float FutureSeconds, |
Get a sampling of where the actor is projected to be in the future, based on a current state. | |
| FVector | Get the current acceleration due to gravity (cm/s^2) in worldspace. | ||
| const FMoverInputCmdContext & | Access the most recently-used inputs. Check @HasValidCachedInputCmd first. | ||
| UPrimitiveComponent * | Get the current movement base. Null if there isn't one. | ||
| FName | Get the current movement base bone, NAME_None if there isn't one. | ||
| FVector | Get the intended movement direction in worldspace with magnitude (range 0-1) | ||
| FName | Get the current movement mode name. | ||
| USceneComponent * | Access the primary visual component of the actor. | ||
| T * | Typed accessor to primary visual component. | ||
| const UMoverBlackboard * | Access the read-only version of the Mover's Blackboard. | ||
| UMoverBlackboard * | |||
| TArray< FString > | |||
| const FMoverSyncState & | GetSyncState () |
Access the most recent captured sync state. Check @HasValidCachedState first. | |
| FRotator | Get the orientation that the actor is moving towards. | ||
| FTransform | Get the transform of the root component that our Mover simulation is moving. | ||
| FVector | Get the normalized direction considered "up" in worldspace. Typically aligned with gravity, and typically determines the plane an actor tries to move along. | ||
| FVector | GetVelocity () |
Get the current velocity (units per second, worldspace) | |
| void | HandleImpact
(
FMoverOnImpactParams& ImpactParams |
Handle a blocking impact. | |
| bool | Signals whether we have input data saved yet. If not, input queries will not be meaningful. | ||
| bool | Signals whether we have a sync state saved yet. If not, most queries will not be meaningful. | ||
| void | InitializeSimulationState
(
FMoverSyncState* OutSync, |
Seed initial values based on component's state. Called by Network Prediction system. | |
| bool | |||
| void | K2_FindActiveLayeredMove
(
bool& DidSucceed, |
Retrieves an active layered move, by writing to a target instance if it is the matching type. | |
| void | K2_QueueLayeredMove
(
UPARAM(DisplayName="Layered Move") const int32& MoveAsRawData |
Queue a layered move to start during the next simulation frame. | |
| void | OnBeginOverlap
(
UPrimitiveComponent* OverlappedComp, |
Callbacks. | |
| void | OnHandleImpact
(
const FMoverOnImpactParams& ImpactParams |
||
| void | OnSimulationRollback
(
const FMoverSyncState* SyncState, |
Called when a rollback occurs, after the simulation state has been restored | |
| void | PhysicsVolumeChanged
(
APhysicsVolume* NewVolume |
||
| void | ProcessFirstSimTickAfterRollback
(
const FMoverTimeStep& TimeStep |
||
| void | ProduceInput
(
const int32 DeltaTimeMS, |
Get latest local input prior to simulation step. Called by Network Prediction system on owner's instance (autonomous or authority). | |
| void | QueueLayeredMove
(
TSharedPtr< FLayeredMoveBase > Move |
Queue a layered move to start during the next simulation frame. | |
| void | QueueNextMode
(
FName DesiredModeName, |
Queue a movement mode change to occur during the next simulation frame. If bShouldReenter is true, then a mode change will occur even if already in that mode. | |
| void | Internal function to ensure SharedSettings array matches what's needed by the list of Movement Modes | ||
| bool | RemoveMovementMode
(
FName ModeName |
Removes a movement mode from available movement modes. Returns number of modes removed from the available movement modes. | |
| void | RestoreFrame
(
const FMoverSyncState* SyncState, |
Restore a previous frame prior to resimulating. Called by Network Prediction system. | |
| void | SetFrameStateFromContext
(
const FMoverSyncState* SyncState, |
Makes this component and owner actor reflect the state of a particular frame snapshot. | |
| void | SetGravityOverride
(
bool bOverrideGravity, |
Set gravity override, as a directional acceleration in worldspace. Gravity on Earth would be {x=0,y=0,z=-980}. | |
| void | SetUpdatedComponent
(
USceneComponent* NewUpdatedComponent |
Basic "Update Component/Ticking". | |
| void | SimulationTick
(
const FMoverTimeStep& InTimeStep, |
Primary movement simulation update. Given an starting state and timestep, produce a new state. Called by Network Prediction system. | |
| bool | TryGetFloorCheckHitResult
(
FHitResult& OutHitResult |
Access the most recent floor check hit result. | |
| void | UpdateBasedMovementScheduling
(
const FMoverTickEndData& SimOutput |
Internal function to perform post-sim scheduling to optionally support simple based movement | |
| void | |||
| bool | ValidateSetup
(
FDataValidationContext& ValidationErrors |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | BeginPlay () |
Begins Play for the component. | |
| void | Initializes the component. | ||
| void | OnRegister () |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. | |
| void | RegisterComponentTickFunctions
(
bool bRegister |
Virtual call chain to register all tick functions | |
| void | TickComponent
(
float DeltaTime, |
Function called every frame on this ActorComponent. | |
| void | Handle this component being Uninitialized. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| EDataValidationResult | IsDataValid
(
FDataValidationContext& Context |
Generic function to validate objects during changelist validations, etc. | |
| void | PostCDOCompiled
(
const FPostCDOCompiledContext& Context |
Called after the Blueprint compiler has finished generating the Class Default Object (CDO) for a class. | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | PostTransacted
(
const FTransactionObjectEvent& TransactionEvent |
Called after the object has been transacted in some way. | |
| void | PreSave
(
FObjectPreSaveContext ObjectSaveContext |
Presave function. |