AActor::K2_AddActorWorldTransformKeepScale
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Adds a delta transform to the actor in world space while preserving the actor's current scale. Use this instead of K2_AddActorWorldTransform when you do not want the actor's scale reset to (1,1,1).
Caveats & Gotchas
- • Despite accepting a full FTransform delta, the scale component of DeltaTransform is still ignored — only the existing actor scale is preserved, not multiplied by the delta scale.
- • Added in UE 4.14 specifically to address the scale-destroying behaviour of K2_AddActorWorldTransform. In older engines this function does not exist.
Signature
ENGINE_API void K2_AddActorWorldTransformKeepScale(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaTransform | const FTransform& | The delta transform to apply. Scale is ignored in the delta but the actor's existing scale is preserved. | — |
| bSweep | bool | Whether to sweep to the new location during the translation. | — |
| 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, physics velocity is updated based on displacement. | — |
Return Type
void Example
Move and rotate a scaled actor without losing its scale C++
FTransform Delta(FRotator(0.f, 30.f, 0.f), FVector(100.f, 0.f, 0.f));
FHitResult Hit;
// Actor scale remains unchanged (e.g., (2,2,2))
MyActor->K2_AddActorWorldTransformKeepScale(Delta, false, Hit, false); Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?