I started studying "First Unity" on the official Unity website.
using System.Collections;
using System.Collections.General;
using UnityEngine;
public class DangerWall:MonoBehavior {
// Callback called when in contact with an object
void OnCollisionEnter (Collision hit)
{
// If the tag of the object you contacted is "Player"
if(hit.gameObject.CompareTag("Player")){
// Get current scene number
intsceneIndex=SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(sceneIndex);
}
}
}
The error only occurs in
int sceneIndex=SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(sceneIndex);
in the
section of
eSceneManager does not exist in this context br
The error appears.
Please tell me where the problem is!
Obstacle and Restart→The use seems to be insufficient compared to the re-read scene code.
This may be the cause of the error.
using the link
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEngine.SceneManagement;
is required.
619 Uncaught (inpromise) Error on Electron: An object could not be cloned
578 Understanding How to Configure Google API Key
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.