AActor::K2_AddActorLocalOffset
#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
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); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?