Skip to content

Commit

Permalink
fix crash that happens when you manually place the BP_FlyingPawn, BP_…
Browse files Browse the repository at this point in the history
…CameraDirector, BP_PIPCamera.
  • Loading branch information
lovettchris committed May 12, 2017
1 parent b893a32 commit 4f35976
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Unreal/Plugins/AirSim/Source/CameraDirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ ACameraDirector::ACameraDirector()

void ACameraDirector::BeginPlay()
{
setupInputBindings();

if (left_binding_ == nullptr) {
setupInputBindings();
}
Super::BeginPlay();
}

Expand All @@ -34,6 +35,8 @@ ECameraDirectorMode ACameraDirector::getMode()

void ACameraDirector::initializeForBeginPlay()
{
setupInputBindings();

camera_start_location_ = this->GetActorLocation();
camera_start_rotation_ = this->GetActorRotation();
initial_ground_obs_offset_ = camera_start_location_ - TargetPawn->GetActorLocation();
Expand All @@ -48,7 +51,6 @@ void ACameraDirector::initializeForBeginPlay()
void ACameraDirector::setMode(ECameraDirectorMode mode)
{
mode_ = mode;

if (mode_ == ECameraDirectorMode::CAMERA_DIRECTOR_MODE_MANUAL) {
camera_location_manual_ = ExternalCamera->GetActorLocation();
camera_rotation_manual_ = ExternalCamera->GetActorRotation();
Expand Down

0 comments on commit 4f35976

Please sign in to comment.