You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
473 B
GDScript

2 years ago
extends Control
@onready var animation: AnimationPlayer = $AnimationPlayer as AnimationPlayer
2 years ago
@onready var camera: CameraManager = Global.camera_mgr
2 years ago
var target: Character
2 years ago
func _ready():
2 years ago
visible = false
animation.play("rotate")
func _process(delta):
2 years ago
if target:
position = camera.get_screen_pos(target.ui_pos_center())
func on_target_changed(target_id: int):
target = Global.character_mgr.get_character(target_id)
visible = target != null