If a static mesh component has Simulate Physics enabled, GetRelativeTransform() returns the value of world transform.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "mesh") UStaticMeshComponent* comp; UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "mesh") USceneComponent* Scene;
#include "Engine.h"
comp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Comp")); Scene = CreateDefaultSubobject<USceneComponent>(TEXT("Scene")); RootComponent = Scene;
UE_LOG(LogTemp, Warning, TEXT("world transform=%s"), *comp->GetComponentTransform().ToString()); UE_LOG(LogTemp, Warning, TEXT("relative transform=%s"), *comp->GetRelativeTransform().ToString()); if (GEngine) { GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Magenta, *comp->GetComponentTransform().ToString()); GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Cyan, *comp->GetRelativeTransform().ToString()); }
Result:
PIE(1) reports relative transform in game and logs as expected. PIE(2) reports relative transform as the exact same as World transform
Expected:
Simulate Physics does not affect relative transform
Repro Rate:
3/3
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
Delay nodes occasionally don't fire the "Completed" output in a nativized build
I am not able to find world outliner how to enable it?
How does Character rotate in the current position in the blueprint?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
An error occurred while trying to generate project files !?
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay |
---|
Created | May 3, 2016 |
---|---|
Resolved | May 4, 2016 |
Updated | Jul 14, 2021 |