AActor::K2_AddActorWorldOffset
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Adds a delta to the actor's world-space location. This is the Blueprint-exposed version of AddActorWorldOffset; in C++ prefer calling AddActorWorldOffset directly for cleaner syntax.
Caveats & Gotchas
- • The K2_ prefix marks this as the Blueprint (Kismet 2) wrapper — in C++ code, call AddActorWorldOffset instead, which uses ETeleportType and optional hit result pointers rather than the bool/ref signature.
- • Only the RootComponent participates in the sweep — child components are moved without collision checks. If bSweep is false and physics is active, attached simulated components (e.g., ragdoll parts) will not follow unless bTeleport is true.
Signature
ENGINE_API void K2_AddActorWorldOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaLocation | FVector | The change in location to apply in world space. | — |
| bSweep | bool | If true, sweeps to the destination and stops if blocked. Only the root component is swept. | — |
| SweepHitResult | FHitResult& | Output hit result populated when bSweep is true and a blocking hit occurs. | — |
| bTeleport | bool | If true, physics velocity is preserved (teleport semantics). If false, velocity is updated based on displacement. | — |
Return Type
void Examples
Nudge the actor 100 units along the world X axis on BeginPlay
Blueprint
Nudge an actor forward in world space with sweep C++
// Prefer AddActorWorldOffset in C++; K2_ is for Blueprint bindings
FHitResult Hit;
MyActor->K2_AddActorWorldOffset(FVector(100.f, 0.f, 0.f), true, Hit, false);
if (Hit.bBlockingHit)
{
UE_LOG(LogTemp, Log, TEXT("Blocked by %s"), *Hit.GetActor()->GetName());
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?