• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by DrDeadlock · Dec 07, 2020 at 08:33 PM · scripting problemerrorbuildscene-loadingdrag-and-drop

Drag scene object works in editor but not in release

Hello world,

I am working in the Unity Editor 2019.4.8f1 and have a little problem. Please imagine an empty scene with a GameObject, where the following script is attached to:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 public class TransportTest : MonoBehaviour
 {
     public Object scene;
 
     private void Start()
     {
         SceneManager.LoadScene(scene.name);
     }
 }

The public Object scene was a scene, dragged&dropped from the project view into the objects script component. Running this script in the Editor works pretty well. But when I use this in a built version of the game, I get a null reference exception. Here's what the log says:

Mono path[0] = 'C:/Users/SteakTop/Desktop/Unity Projects/Prototype Light in the Lost/Build v0.4.7/Prototype Light in the Lost_Data/Managed' Mono config path = 'C:/Users/SteakTop/Desktop/Unity Projects/Prototype Light in the Lost/Build v0.4.7/MonoBleedingEdge/etc' PlayerConnection initialized from C:/Users/SteakTop/Desktop/Unity Projects/Prototype Light in the Lost/Build v0.4.7/Prototype Light in the Lost_Data (debug = 0) PlayerConnection initialized network socket : 0.0.0.0 55313 Multi-casting "[IP] 192.168.8.100 [Port] 55313 [Flags] 3 [Guid] 700479046 [EditorId] 2792049016 [Version] 1048832 [Id] WindowsPlayer(LAPTOP-RA4VVA5H) [Debug] 1 [PackageName] WindowsPlayer [ProjectName] Prototype Light in the Lost" to [225.0.0.222:54997]... Waiting for connection from host on [0.0.0.0:55313]... Remaining time:8s Remaining time:7s Remaining time:6s Remaining time:5s Remaining time:4s Remaining time:3s Remaining time:2s Remaining time:1s Remaining time:0s Timed out. Continuing without host connection. Started listening to [0.0.0.0:55313] Starting managed debugger on port 56046 Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56046 PlayerConnection already initialized - listening to [0.0.0.0:55313] Initialize engine version: 2019.4.8f1 (60781d942082) [Subsystems] Discovering subsystems at path C:/Users/SteakTop/Desktop/Unity Projects/Prototype Light in the Lost/Build v0.4.7/Prototype Light in the Lost_Data/UnitySubsystems GfxDevice: creating device client; threaded=1 Direct3D: Version: Direct3D 11.0 [level 11.0] Renderer: NVIDIA GeForce GTX 950M (ID=0x139a) Vendor: (null) VRAM: 2010 MB Driver: 26.21.14.4614 Begin MonoManager ReloadAssembly - Completed reload, in 0.218 seconds D3D11 device created for Microsoft Media Foundation video decoding. Initializing input.

Input initialized.

Initialized touch support.

UnloadTime: 1.253800 ms NullReferenceException: Object reference not set to an instance of an object at TransportTest.Start () [0x00001] in C:\Users\SteakTop\Desktop\Unity Projects\Prototype Light in the Lost\Assets\TransportTest.cs:12
(Filename: C:/Users/SteakTop/Desktop/Unity Projects/Prototype Light in the Lost/Assets/TransportTest.cs Line: 12)

I tripple checked, that the scene is added to the build settings / scene in build. I use the Mono compiler. (The L2cpp compiler didn't want to work) My target plattform is Windows. I have really no idea what is going on here and try to troubleshoot this problem for days now. Does anybody have a hint or a solution? Or nearly an explanation why this may not ever work?

Thanks in advance.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

300 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Build Error 1 Answer

Built project, now scripts are missing. 2 Answers

In Script Graph, Why Blackboard Object Variables are disabled but Scene Variables are not? 0 Answers

Getting an error while trying to get scene name 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges