From 491fb265b1eb91a343a8884ecafe847c66289d41 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Fri, 28 May 2021 05:02:24 -0400 Subject: [PATCH] Have waypoints check if the camera is current If not, get the current camera. --- 3d/physics_tests/utils/rigidbody_ground_check.gd | 1 - 3d/waypoints/waypoint.gd | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/3d/physics_tests/utils/rigidbody_ground_check.gd b/3d/physics_tests/utils/rigidbody_ground_check.gd index 1b87fbb6..74976a6e 100644 --- a/3d/physics_tests/utils/rigidbody_ground_check.gd +++ b/3d/physics_tests/utils/rigidbody_ground_check.gd @@ -44,4 +44,3 @@ func ground_check(): _is_on_floor = true else: _is_on_floor = false - diff --git a/3d/waypoints/waypoint.gd b/3d/waypoints/waypoint.gd index 335eb8a7..36dbec9e 100644 --- a/3d/waypoints/waypoint.gd +++ b/3d/waypoints/waypoint.gd @@ -23,6 +23,9 @@ func _ready() -> void: func _process(_delta): + if not camera.current: + # If the camera we have isn't the current one, get the current camera. + camera = get_viewport().get_camera() var parent_translation = parent.global_transform.origin var camera_transform = camera.global_transform var camera_translation = camera_transform.origin