extends PlayerState

@export var time_to_square:= 0.2

var target : Vector2 = Vector2.ZERO


func _enter_state():
	player.area_2d.set_deferred("monitoring", true)
	player.area_2d.set_deferred("monitorable", true)
	target = player.current_path_node.global_position
		
	var tween = create_tween().tween_property(player, "global_position", target, time_to_square)
	await tween.finished
	player.state_machine.switch_state($"../PlayerStatePop")


func _exit_state():
	target = Vector2.ZERO
	
