-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOBSERVATION2GameMode.cpp
More file actions
30 lines (22 loc) · 1012 Bytes
/
OBSERVATION2GameMode.cpp
File metadata and controls
30 lines (22 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Epic Games, Inc. All Rights Reserved.
#include "OBSERVATION2GameMode.h"
#include "OBSERVATION2Character.h"
#include "CameraManager.h"
#include "Kismet/GameplayStatics.h"
#include "UObject/ConstructorHelpers.h"
AOBSERVATION2GameMode::AOBSERVATION2GameMode()
: Super()
{
// set default pawn class to our Blueprinted character
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/FirstPerson/Blueprints/BP_FirstPersonCharacter"));
DefaultPawnClass = PlayerPawnClassFinder.Class;
PlayerControllerClass = ACameraPlayerController::StaticClass();
}
void AOBSERVATION2GameMode::BeginPlay()
{
Super::BeginPlay();
// Get CameraManager from the World and assign it to CameraManagerRef
CameraManagerRef = Cast<ACameraManager>(UGameplayStatics::GetActorOfClass(GetWorld(), ACameraManager::StaticClass()));
// Alternatively, if CameraManager is derived from GameMode:
// CameraManagerRef = GetWorld()->GetAuthGameMode<ACameraManager>();
}