]> Untitled Git - william-skin.git/blob - test/test.gd
Bugfixes
[william-skin.git] / test / test.gd
1 extends Node3D
2
3
4 @onready var player = $player
5
6
7 func _input(event: InputEvent) -> void:
8         if event.is_action_pressed("left_click"):
9                 Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
10         elif event.is_action_pressed("ui_cancel"):
11                 if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE:
12                         get_tree().quit()
13                 else:
14                         Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
15
16
17 func _on_player_camera_lockon() -> void:
18         # Pass everything that's part of the lockon group to the player
19         # within a certain radius
20         var arr := get_tree().get_nodes_in_group("player-lockon")
21         player.set_camera_lockon(arr)