extends Control

@onready var animation = $AnimationPlayer as AnimationPlayer
@onready var camera: CameraManager = Global.camera_mgr

var target : Character

func _ready():
	visible = false
	animation.play("rotate")

func _process(delta):
	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
