Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Build setting errors

Discussion in 'Scripting' started by motionfil, Apr 19, 2017.

  1. motionfil

    motionfil

    Joined:
    Apr 15, 2017
    Posts:
    1
    I'm using Unity 5.6.0f3 and have come across this error when I try build and run. Ive checked in monodevelop building and running script and it says build success. when I try for windows/mac/Linux standalone I get the below error messages.

    Assets/Scripts/LevelManager.cs(4,19): error CS0234: The type or namespace name SceneManagement' does not exist in the namespaceUnityEngine'. Are you missing an assembly reference?

    Assets/Scripts/LevelManager.cs(6,29): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?

    Error building Player because scripts had compiler errors

    .cs is as follows

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

    public class LevelManager : MonoBehaviour {
    public void Loadevel(string name) {
    Debug.Log("Level load requested for: " + name);
    SceneManager.LoadScene(name);
    Debug.Log("Loaded Level " + name);
    }

    public void QuitLevel(string name) {
    Debug.Log("I want to Quit");
    Application.Quit();
    }
    }

    am I missing something simple?
     
  2. brownce

    brownce

    Joined:
    Sep 14, 2015
    Posts:
    18
    We encountered this error when we were trying to do an iOS build. The scripts themselves didn't show errors, but we got errors when trying to build. The mac guy deleted the library and let everything reimport to get it fixed.