20 lines
396 B
C#
Raw Permalink Normal View History

2023-06-18 21:34:09 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadSceneOnCollision: MonoBehaviour
{
public string newGameScene;
void OnTriggerEnter2D(Collider2D other)
{
if(other.CompareTag("Player")){
Debug.Log("SceneLoader: Next Scene");
SceneManager.LoadScene(newGameScene);}
}
}