Hi I’m trying to set up a game instance to carry data through my maps. However, I’m having trouble setting it up. I keep getting an access violation nullptr thing now matter what code from the instance I call. My code looks like:
Header:
UPROPERTY(EditAnywhere)
UAssignmentGameInstance* GameInstanceRef;
Cpp:
In the beginplay function,
GameInstanceRef = Cast(UGameplayStatics::GetGameInstance(GetWorld()));
then when I call the code from the game instance class
GameInstance->IsDead = true;
thank you