Last active
May 19, 2024 12:01
-
-
Save sabotai/7768d154c4a4446fb7fdbaaa971d176f to your computer and use it in GitHub Desktop.
Easy Trigger Scene Load Unity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.SceneManagement; | |
//HOW TO USE:: | |
//make a new "C# Script" in the project tab and give it the name "SceneLoad" | |
//open up the new script and paste the entire contents | |
//attach the new script to your player object | |
//Create a new GameObject, adding one of the Collider2D components | |
//check the "is trigger" box for the collider settings | |
public class SceneLoad : MonoBehaviour { | |
void OnTriggerEnter2D(Collider2D other) { | |
Debug.Log ("GOGOGOGO SCENE"); | |
SceneManager.LoadScene("SCENENAME"); //load this scene... change SCENENAME to the name of the scene you want | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment