AActor::GetLevelTransform
#include "GameFramework/Actor.h"
Access: public
Specifiers: const
Description
Returns the transform of the ULevel this actor belongs to. Useful in world composition or level streaming scenarios where the level itself has been offset from the origin.
Caveats & Gotchas
- • In a standard single-level game this returns an identity transform; it is only meaningful when world composition or level streaming has applied a non-identity level transform.
- • Actor locations stored in the level are relative to the level transform, not the world origin — failing to account for this is a common source of misaligned positions when loading sublevels.
Signature
ENGINE_API FTransform GetLevelTransform() const Return Type
FTransform Example
Convert actor location to level-local space C++
FTransform LevelTM = GetLevelTransform();
FVector LocalPos = LevelTM.InverseTransformPosition(GetActorLocation()); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?