How to Change Scenes in Unity Using C# (Unity Tutorial 2021)

Опубликовано: 13 Октябрь 2024
на канале: Omogonix
35,615
770

In this Unity tutorial, I show you all how to change scenes in Unity using C#.

Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class nextscene : MonoBehaviour
{
public string scenename;

void OnTriggerEnter(Collider other){
if(other.CompareTag("Player")){
SceneManager.LoadScene(scenename);
}
}
}

Follow me on Twitter:
  / omogonix  

Forgehub:
https://www.forgehub.com/members/omog...

Subscribe to my Second Channel:
   / @lachlanshelton129  

Join my Discord:
  / discord  

Facebook Page:
  / omogonix  

Follow me on Instagram:
  / uwugonixhalo  

Itch.io:
https://omogonixlachlan.itch.io

Music Used:
-Ship Wrek & Zookeepers - Ark (NCS Release):
   • Ship Wrek & Zookeepers - Ark | Future...