AActor::GetTransform
#include "GameFramework/Actor.h"
Access: public
Specifiers: constUFUNCTIONBlueprintCallable
Description
Returns the actor-to-world transform of the RootComponent. This is the full combined translation, rotation, and scale of the actor in world space.
Caveats & Gotchas
- • Returns a reference to the internal component transform — do not store the reference across frames; retrieve it fresh each time or copy the value with FTransform Copy = GetTransform().
- • If the actor has no RootComponent, the function returns FTransform::Identity, which silently produces world-origin results. Always check that the actor is properly set up if getting unexpected zero transforms.
Signature
const FTransform& GetTransform() const Return Type
const FTransform& Examples
Spawn a projectile at the actor's current world transform
Blueprint
Spawn a projectile at actor transform C++
FTransform SpawnTM = GetTransform();
AMyProjectile* Proj = GetWorld()->SpawnActor<AMyProjectile>(ProjectileClass, SpawnTM); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?