From 9a008356238d06a20e626adde7c3e348c48fa7c4 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 24 Oct 2024 14:59:18 +0200 Subject: [PATCH] FGBuildable.cpp: Fix root component mobility Looking at the game's binaries, the root component of buildables has to default to static mobility. Otherwise, pre-placed buildings do not work properly in the editor. The pre-placed buildings in ExampleLevel should no longer be stuck at 0 (which is inside the starting cube), but the level needs to be resaved. Signed-off-by: Angel Pons --- Source/FactoryGame/Private/Buildables/FGBuildable.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/FactoryGame/Private/Buildables/FGBuildable.cpp b/Source/FactoryGame/Private/Buildables/FGBuildable.cpp index 0d5f0051ad..67c9d04c4e 100644 --- a/Source/FactoryGame/Private/Buildables/FGBuildable.cpp +++ b/Source/FactoryGame/Private/Buildables/FGBuildable.cpp @@ -184,6 +184,7 @@ AFGBuildable::AFGBuildable(const FObjectInitializer& ObjectInitializer) : Super( this->NetDormancy = ENetDormancy::DORM_Initial; this->NetCullDistanceSquared = 5625000000.0; this->RootComponent = CreateDefaultSubobject(TEXT("RootComponent")); + this->RootComponent->SetMobility(EComponentMobility::Static); } void AFGBuildable::Serialize(FArchive& ar){ Super::Serialize(ar); } void AFGBuildable::PostLoad(){ Super::PostLoad(); }