ACharacter::GetBaseTranslationOffset
#include "GameFramework/Character.h"
Access: public
Specifiers: BlueprintCallableconst
Description
Returns the cached translation offset of the mesh relative to the capsule center. This represents how much extra translation the mesh has beyond the capsule, used as the smoothing target during network corrections.
Caveats & Gotchas
- • This value is set by `CacheInitialMeshOffset()` during initialization. If you reposition the mesh at runtime (e.g. for custom idle offsets), call `CacheInitialMeshOffset()` again or the network smoothing interpolation will target the wrong position.
- • This offset is in component-local space, not world space. Do not use it as a world displacement without first applying the capsule's world transform.
- • The value remains constant after construction unless explicitly refreshed with `CacheInitialMeshOffset()`. It does not automatically update if the mesh component's relative location is changed at runtime.
Signature
FVector GetBaseTranslationOffset() const { return BaseTranslationOffset; } Return Type
FVector Example
Log the mesh offset for debugging smoothing issues C++
void AMyCharacter::DebugMeshOffset() const
{
FVector Offset = GetBaseTranslationOffset();
UE_LOG(LogTemp, Display, TEXT("Mesh offset from capsule: %s"), *Offset.ToString());
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?