I have a custom game mode.
AMyGameModeBase::AMyGameModeBase()
{
DefaultPawnClass = MyCharacter::StaticClass();
PlayerControllerClass = MyPlayerController::StaticClass();
}
I created a empty level and reparented the level blueprint to a levelscriptactor I created.
void AMyLevelScriptActor::BeginPlay()
{
Super::BeginPlay();
PlayerController = Cast<MyPlayerController>(UGameplayStatics::GetPlayerController(this, 0));
PlayerController->SetInputMode(FInputModeUIOnly());
PlayerController->bShowMouseCursor = true;
MainMenuUI = CreateWidget<UUserWidget>(GetWorld(), MainMenuUIClass);
if (MainMenuUI != nullptr)
MainMenuUI->AddToViewport();
//Default pawn class of custom mode mode, continues to fall in the world
Player = Cast<MyCharacter>(UGameplayStatics::GetPlayerCharacter(this, 0));
//Spawned character, remains stationary, the desired outcome
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.Instigator = Instigator;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
SpawnedPlayer = GetWorld()->SpawnActor<MyCharacter>(MyCharacterClass, FVector(0.0f), FRotator(0.0f), SpawnParams);
}
SimulatePhysics is disabled in MyCharacter. How do I stop Player from falling?