AActor::AddActorWorldTransform
#include "GameFramework/Actor.h"
Access: public
Description
Applies a delta transform to this actor in world space, combining the delta rotation and location with the current transform. The resulting scale is always reset to (1,1,1) — use AddActorWorldTransformKeepScale to preserve scale.
Caveats & Gotchas
- • The scale component of DeltaTransform is ignored and the actor's scale is forced to (1,1,1) after the call. This is a frequent source of confusion when actors have non-uniform scale. Use AddActorWorldTransformKeepScale if scale must be preserved.
- • In Blueprint, the exposed node is 'Add Actor World Transform' which wraps K2_AddActorWorldTransform — the C++ method differs in that OutSweepHitResult is a pointer rather than a reference.
- • bSweep only sweeps the root component; child components are not swept. Overlap events are generated along the swept path if the components have overlap events enabled.
Signature
ENGINE_API void AddActorWorldTransform(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaTransform | const FTransform& | The transform delta to apply in world space. The scale component is ignored — scale is always reset to (1,1,1). | — |
| bSweep | bool | If true, sweeps to the new position and stops at blocking geometry. | false |
| OutSweepHitResult | FHitResult* | If provided and sweep is enabled, receives the blocking hit result. | nullptr |
| Teleport | ETeleportType | Whether to teleport physics state (TeleportPhysics) or update velocity based on displacement (None). | ETeleportType::None |
Return Type
void Example
Move and rotate an actor by a world-space delta each tick C++
void AMyActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
FTransform Delta(FRotator(0.f, 90.f * DeltaTime, 0.f), FVector(0.f, 0.f, 50.f * DeltaTime));
AddActorWorldTransform(Delta);
} See Also
Tags
Version History
Introduced in: 4.6
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?