maxhacker11

Checkpoint.cs

Nov 19th, 2023
1,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | Source Code | 0 0
  1. using UnityEngine;
  2.  
  3. public class Checkpoint : MonoBehaviour
  4. {
  5.     public BoxCollider2D trigger;
  6.  
  7.     private void OnTriggerEnter2D(Collider2D collision)
  8.     {
  9.         if (collision.CompareTag("Player"))
  10.         {
  11.             RespawnController.Instance.respawnPoint = transform;
  12.             trigger.enabled = false;
  13.         }
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment