Skip to content

Commit

Permalink
FGBuildable.cpp: Fix root component mobility
Browse files Browse the repository at this point in the history
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 <th3fanbus@gmail.com>
  • Loading branch information
Th3Fanbus committed Nov 2, 2024
1 parent 7225036 commit 9a00835
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/FactoryGame/Private/Buildables/FGBuildable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ AFGBuildable::AFGBuildable(const FObjectInitializer& ObjectInitializer) : Super(
this->NetDormancy = ENetDormancy::DORM_Initial;
this->NetCullDistanceSquared = 5625000000.0;
this->RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
this->RootComponent->SetMobility(EComponentMobility::Static);
}
void AFGBuildable::Serialize(FArchive& ar){ Super::Serialize(ar); }
void AFGBuildable::PostLoad(){ Super::PostLoad(); }
Expand Down

0 comments on commit 9a00835

Please sign in to comment.