Answer the question
In order to leave comments, you need to log in
How to connect one object to several scenes?
I'm doing a simple example - switching between scenes. Everything is working.
As you can see in the picture, a SceneChanger object has been created on the scene.
A script with the same name SceneChanger is connected to this object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger : MonoBehaviour
{
public void ChangeScene(int sceneNumber)
{
SceneManager.LoadScene(sceneNumber);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question