P
P
Pavel Rusakov2016-06-16 19:18:43
C++ / C#
Pavel Rusakov, 2016-06-16 19:18:43

How to make a transition between unity3d scenes?

How to make it so that when it collides with a certain object, the level is reloaded on the Internet read that Application.loadlevel(Application.loadedLevel), but unity and the editor write Replace with SceneManager ..... the question is how to replace the second part (Application.loadedLevel) using scene manager? I tried to find using Google gives outdated sites using Application ... (maybe I just searched badly)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vyacheslav, 2016-06-16
@fortegon

using UnityEngine.SceneManagement;
SceneManager.LoadScene("scene_name")

or
using UnityEngine.SceneManagement;
SceneManager.LoadScene(scene_id)

D
durnevdanya, 2016-06-16
@durnevdanya

Create a script and in it:

void ...{
Application.loadlevel("namelevel");
}<code>

M
Metaplay, 2021-01-11
@Metaplay

The easiest way is to write a universal script and switch levels by index
using UnityEngine.SceneManagement;
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex +1); // Get the scene index and load the scene with an index one higher

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question