private void OnTriggerEnter2D(Collider2D other) //player enters finish line { PositionRecorder player = other.attachedRigidbody.GetComponent <PositionRecorder>(); if (player != null && !player.IsFinished() && !player.IsDead()) { SpawnGhost(player.GetPositionHistory()); //spawn new ghost player.FinishLevel(); print("PLAYER FINISHED"); } }