Have waypoints check if the camera is current

If not, get the current camera.
This commit is contained in:
Aaron Franke
2021-05-28 05:02:24 -04:00
parent 08be1b7f03
commit 491fb265b1
2 changed files with 3 additions and 1 deletions

View File

@@ -44,4 +44,3 @@ func ground_check():
_is_on_floor = true
else:
_is_on_floor = false

View File

@@ -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