mirror of
https://github.com/GDQuest/godot-platformer-2d.git
synced 2026-07-24 03:16:55 +00:00
Fix ControlUtils singleton not registering properly
This commit is contained in:
parent
ae54ee9139
commit
a67f0d8424
2 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue