Greetings, I’m getting a really weird issue on PIEs…
A) My GameMode uses the seamlesstravel method to switch between maps (code from required methods on bottom).
B) I have a method on my playercontroller that does spawn a “selfdestroying” actor.
C) Calling this method with direct player input (CODE to key event) works perfectly, it spawns, init the timer and does destroy when the kill event is fired.
D) I have an UMG HUD with a button whose the click event is wired to the BP Node GetPlayerController 0, casts to my Controller class and fires “exactly” the same method.
E) On fire by HUD, I get no spawn on the game world while playing, “BUT”, on Stop Playing the instances are show on my world outliner and plus looks like they become placed actors asking for save the map to commit the changes caused by their inclusion.
Here are the overriden methods, if I do use the default (SUPER) ones I get no spawns by neither input methods.
void My_GameMode::PostSeamlessTravel()
{
//Super::PostSeamlessTravel(); commented to custom behaviour
if (GameSession != NULL)
{
GameSession->PostSeamlessTravel();
}
bWaitingForReadyController = true;
// Picks player 0
APlayerController * LocalClient = UGameplayStatics::GetPlayerController(this, 0);
// Picks the map player Start
AActor * BetterStart = K2_FindPlayerStart(LocalClient);
LocalClient->StartSpot = BetterStart;
// Setups Camera and HUD
LocalClient->SetViewTarget(BetterStart);
LocalClient->ClientSetHUD(HUDClass);
LocalClient->SpawnPlayerCameraManager();
Cast<MyCameraManager>(LocalClient->PlayerCameraManager)->CleanCameraEffectsAndPP();
RestartPlayer(LocalClient);
Cast<AMyCharacter>(LocalClient->GetPawn())->BootPlayerAudioListener(); // Just a custom method to override audio sensing
}
bool My_GameMode::ReadyToStartMatch()
{
//return Super::ReadyToStartMatch(); commented to custom behaviour
return !bWaitingForReadyController;
}
void My_GameMode::HandleSeamlessTravelPlayer(AController*& C)
{
//Super::HandleSeamlessTravelPlayer(C); commented to custom behaviour
}
void AVIDA_GameMode::StartNewPlayer(APlayerController* NewPlayer)
{
//Super::StartNewPlayer(NewPlayer); commented to custom behaviour
NewPlayer->InitPlayerState();
NewPlayer->ClientSetHUD(HUDClass);
}
Looks like the HUD (whose is there just one instance running) is accessing another instance from something, but I have no idea what.
Any tips will be amazing.
Thank you