using System.Collections; using System.Collections.Generic; using UnityEngine; public class CheckPoint : MonoBehaviour{ public Transform checkpointPos; void OnTriggerEnter2D(Collider2D col){ if (col.CompareTag("Player")){ col.GetComponent().lastCheckpoint = checkpointPos.position; } } void OnDrawGizmos(){ Gizmos.color = Color.green; BoxCollider2D col = GetComponent(); Gizmos.DrawWireCube(col.transform.position, col.size); } }