I have my custom game instance, and have one LevelStore. In my playercontroller, I have one UObject that registers as a listener to the store. When the listener is notified by the store to create static mesh actors, I get this warning “PIE: Warning: Calling SetStaticMesh on ‘/Game/Level/Farm/Maps/UEDPIE_0_Farm.Farm:PersistentLevel.CFStaticMeshActor_0.StaticMeshComponent0’ but Mobility is Static.” . Then fail to create mesh actors. I have no clue how to fix it.
UCLASS()
class UCFGameInstance : public UGameInstance
{
GENERATED_BODY()
int SelectedCharacterIndex;
bool LocalTest;
void OnStart() override;
UPROPERTY()
UCFLevelStore* LevelStore;
public:
UCFGameInstance();
..
}
void UCFLevelStore::NotifyListener(FLevelActionType type) {
for (int i = 0; i < StoreListeners.Num(); i++) {
TScriptInterface<ICFLevelStoreInterface> StoreListener = StoreListeners[i];
UObject* LevelStoreObject = StoreListener.GetObject();
if (LevelStoreObject) {
ICFLevelStoreInterface::Execute_OnLevelStoreDidLoadDefinition(LevelStoreObject);
}
}
}
Hope any one know how to solve this. In addition, its even nicer to know what the best practice of ‘Flux’ is in UE4 development. I do need shared store.
Thanks