RealDocs

AActor::K2_AddActorLocalOffset

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Adds a delta to the actor's location in its own local space. Moving along local X moves the actor forward relative to its current facing, regardless of world orientation.

Caveats & Gotchas

  • Local space is defined by the actor's current world rotation, so the actual world-space displacement depends on where the actor is facing. This differs from K2_AddActorWorldOffset which always moves along world axes.
  • In C++ prefer AddActorLocalOffset, which uses ETeleportType and an optional FHitResult pointer instead of the bool/ref Blueprint binding.

Signature

ENGINE_API void K2_AddActorLocalOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);

Parameters

Name Type Description Default
DeltaLocation FVector The change in location in the actor's local reference frame.
bSweep bool Whether to sweep to the destination, stopping if a blocking hit is encountered.
SweepHitResult FHitResult& Output hit result populated when bSweep is true and a blocking hit occurs.
bTeleport bool If true, physics velocity is preserved. If false, velocity is updated based on the displacement.

Return Type

void

Examples

Move the actor 200 units forward in its local space each tick Blueprint
Event Tick Delta Seconds Delta Seconds Add Actor Local Offset Target is Actor Delta Location Sweep false Teleport false Sweep Hit Result Make Vector X 200.0 Y 0.0 Z 0.0 Return Value Return Value
Edit Blueprint graph Move the actor 200 units forward in its local space each tick
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Move actor forward in its local space C++
FHitResult Hit;
// Moves 200 UU forward regardless of which direction the actor faces
MyActor->K2_AddActorLocalOffset(FVector(200.f, 0.f, 0.f), true, Hit, false);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.