RealDocs

AActor::K2_SetActorTransform

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

Description

Sets the actor's world-space transform (location, rotation, and scale) in one call. Returns true if the move was fully applied, false if blocked by a sweep.

Caveats & Gotchas

  • When bSweep is true and a blocking hit stops the actor short, the return value is false and the actor ends up at the blocked position, not the requested NewTransform — always check the return value or SweepHitResult when sweep behaviour matters.
  • In C++ prefer SetActorTransform, which uses ETeleportType for physics semantics and takes an optional FHitResult pointer. The K2_ version is the Blueprint binding.

Signature

ENGINE_API bool K2_SetActorTransform(const FTransform& NewTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);

Parameters

Name Type Description Default
NewTransform const FTransform& The desired world-space transform to apply to the actor.
bSweep bool Whether to sweep to the destination, stopping short 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 (teleport semantics). If false, physics velocity is updated to reflect the displacement.

Return Type

bool

Examples

Teleport the player to an exact world transform on BeginPlay Blueprint
Event BeginPlay Cast To MyCharacter Object Cast Failed As My Character As My Character Set Actor Transform Target is Actor Target New Transform Sweep false Teleport true Return Value Sweep Hit Result Get Player Character Player Index 0 0 Return Value Make Transform Location Rotation Scale (1.0, 1.0, 1.0) (1.0, 1.0, 1.0) Return Value
Edit Blueprint graph Teleport the player to an exact world transform on BeginPlay
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Teleport an actor to an exact world transform C++
FTransform TargetTransform(FRotator(0.f, 90.f, 0.f), FVector(500.f, 200.f, 100.f), FVector(1.f));
FHitResult Hit;
bool bMoved = MyActor->K2_SetActorTransform(TargetTransform, false, Hit, true);

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.