USceneComponent::MoveComponent

Tries to move the component by a movement vector (Delta) and sets rotation to NewRotation.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/SceneComponent.h

Include

#include "Components/SceneComponent.h"

Source

/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp

Syntax

bool MoveComponent
(
    const FVector & Delta,
    const FRotator & NewRotation,
    bool bSweep,
    FHitResult * Hit,
    EMoveComponentFlags MoveFlags,
    ETeleportType Teleport
)

Remarks

Tries to move the component by a movement vector (Delta) and sets rotation to NewRotation. Assumes that the component's current location is valid and that the component does fit in its current Location. Dispatches blocking hit notifications (if bSweep is true), and calls UpdateOverlaps() after movement to update overlap state.

This simply calls the virtual MoveComponentImpl() which can be overridden to implement custom behavior.

The overload taking rotation as an FQuat is slightly faster than the version using FRotator (which will be converted to an FQuat)..

Returns

True if some movement occurred, false if no movement occurred.

Parameters

Parameter

Description

Delta

The desired location change in world space.

NewRotation

The new desired rotation in world space.

bSweep

Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something. Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.

Teleport

Whether we teleport the physics state (if physics collision is enabled for this object). If TeleportPhysics, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location). If None, physics velocity is updated based on the change in position (affecting ragdoll parts). If CCD is on and not teleporting, this will affect objects along the entire swept volume.

Hit

Optional output describing the blocking hit that stopped the move, if any.

MoveFlags

Flags controlling behavior of the move.

Teleport

Determines whether to teleport the physics body or not. Teleporting will maintain constant velocity and avoid collisions along the path

See Also

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