|
Gameplay用起来很巴适,但是有时候就会折腾一下,然后就遇到一些不注意的东西!
Mixing AGameState with AGameModeBase is not compatible. Change AGameModeBase subclass (bp_BaseGameMode_C) to derive from AGameMode, or make both derive from Base因为项目中并没有使用AGameMode,使用的是AGameModeBase,在AGameModeBase的代码中
/** GameState is used to replicate game state relevant properties to all clients. */
UPROPERTY(Transient)
TObjectPtr<AGameStateBase> GameState;
而AGameMode中的是
void AGameMode::InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage)
{
Super::InitGame(MapName, Options, ErrorMessage);
SetMatchState(MatchState::EnteringMap);
if (GameStateClass == nullptr)
{
UE_LOG(LogGameMode, Error, TEXT(&#34;GameStateClass is not set, falling back to AGameState.&#34;));
GameStateClass = AGameState::StaticClass();
}
else if (!GameStateClass->IsChildOf<AGameState>())
{
UE_LOG(LogGameMode, Error, TEXT(&#34;Mixing AGameStateBase with AGameMode is not compatible. Change AGameStateBase subclass (%s) to derive from AGameState, or make both derive from Base&#34;), *GameStateClass->GetName());
}
...
}
https://ai-gaminglife.hatenablog.com/entry/2018/07/23/115923
所以要求是项目的MyGameMode继承的是哪个Mode,就是用对应的GameState! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|