Hello guys,
Trying to update my project. On top of errors with the server target no longer working I’m now getting an error with my “myplayercontroller”
My respawn function is giving an error cast from
Base to derived requires dynamic_cast or static_cast
This was not and error before 4.14
Cpp file:
#include “Gibball.h”
#include “MyPlayerController.h”
#include “MyPlayerState.h”
void AMyPlayerController::OnKilled()
{
UnPossess();
GetWorldTimerManager().SetTimer(TimerHandle_Respawn, this, &AMyPlayerController::Respawn, 5.f);
}
void AMyPlayerController::Respawn()
{
AGameMode * GameMode = GetWorld()->GetAuthGameMode();
if (GameMode)
{
APawn * NewPawn = GameMode->SpawnDefaultPawnFor(this, GameMode->ChoosePlayerStart(this));/ Possess(NewPawn);
}
}
void AMyPlayerController::OnResetJock()
{
UnPossess();
GetWorldTimerManager().SetTimer(TimerHandle_Resetplayer, this, &AMyPlayerController::Respawn, 0.5f);
}
Sorry for the bad formatting currently mobile.