From a67f0d84241537bef5654c357acbb00c944fff74 Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Sun, 19 May 2019 22:58:14 +0900 Subject: [PATCH] Fix ControlUtils singleton not registering properly --- prototypes/1.hook-movement/CameraRig.gd | 2 +- prototypes/1.hook-movement/ControlUtils.gd | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/prototypes/1.hook-movement/CameraRig.gd b/prototypes/1.hook-movement/CameraRig.gd index 1a0645a..2d70490 100644 --- a/prototypes/1.hook-movement/CameraRig.gd +++ b/prototypes/1.hook-movement/CameraRig.gd @@ -20,7 +20,7 @@ func update_position(velocity:Vector2) -> void: _camera.position = distance_ratio * mouse_position.normalized() * offset Settings.GAMEPAD: - var joystick_direction: = get_aim_joystick_direction() + var joystick_direction: = ControlUtils.get_aim_joystick_direction() if Input.is_action_pressed("move_right") or Input.is_action_pressed("move_left"): _camera.position.x = sign(velocity.x) * offset.x _camera.position.y = joystick_direction.y * offset.y diff --git a/prototypes/1.hook-movement/ControlUtils.gd b/prototypes/1.hook-movement/ControlUtils.gd index 1694aaa..8a4fb16 100644 --- a/prototypes/1.hook-movement/ControlUtils.gd +++ b/prototypes/1.hook-movement/ControlUtils.gd @@ -1,4 +1,5 @@ """Global utility methods to extend what's available from the Input singleton""" +extends Node static func get_aim_joystick_direction() -> Vector2: