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