AActor::GetActorRelativeScale3D
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallableconst
Description
Returns the actor's RootComponent scale relative to its parent actor. When the actor has no parent, this equals the world-space scale.
Caveats & Gotchas
- • Returns relative scale, not world scale. If the parent has a scale of (2,2,2) and this actor's relative scale is (0.5,0.5,0.5), the world scale is (1,1,1) — use GetActorScale3D to get the world-space result.
- • This reads RelativeScale3D from the RootComponent directly. If the RootComponent is null (actor with no root), calling this will crash.
Signature
ENGINE_API FVector GetActorRelativeScale3D() const; Return Type
FVector Examples
Grow the actor 50% by multiplying its relative scale on BeginPlay
Blueprint
Log relative vs world scale for debugging C++
FVector RelScale = MyActor->GetActorRelativeScale3D();
FVector WorldScale = MyActor->GetActorScale3D();
UE_LOG(LogTemp, Log, TEXT("Relative: %s World: %s"), *RelScale.ToString(), *WorldScale.ToString()); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?