1 using System.Collections;
2 using System.Collections.Generic;
5 public class Checkpoint : MonoBehaviour
7 private CheckpointManager cm;
11 cm = GameObject.FindGameObjectWithTag("CheckpointManager").GetComponent<CheckpointManager>();
14 void OnTriggerEnter2D(Collider2D collision)
16 if(collision.CompareTag("Player"))
18 cm.lastCheckpointPos = transform.position;