uesvon icon indicating copy to clipboard operation
uesvon copied to clipboard

Crash when doing "Simulate"

Open Dalai- opened this issue 5 years ago • 0 comments

This piece of code crashes if you do "Simulate", since the player controller doesn't have a pawn. That if (pc) line needs to be if (pc && pc->GetPawn())

bool ASVONVolume::Generate()
{
#if WITH_EDITOR
	// Needed for debug rendering
	GetWorld()->PersistentLineBatcher->SetComponentTickEnabled(false);

	// If we're running the game, use the first player controller position for debugging
	APlayerController* pc = GetWorld()->GetFirstPlayerController();
	if (pc)
	{
		myDebugPosition = pc->GetPawn()->GetActorLocation();
	}

Dalai- avatar Sep 07 '20 02:09 Dalai-