Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class RespawnController : MonoBehaviour
- {
- public static RespawnController Instance;
- public Transform respawnPoint;
- private void Awake()
- {
- Instance = this;
- }
- private void OnTriggerEnter2D(Collider2D collision)
- {
- if (collision.CompareTag("Player"))
- {
- collision.transform.position = respawnPoint.position;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment