Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by monobanana · Mar 06, 2020 at 10:31 AM · build-errornullreferenceexceptionbuild errornull reference exception

Bogus Null Reference in Build only,Bogus Phony NULL REFERENCE in BUILD ONLY (works in editor)

Game works fine in editor, but the build has bugs. Thus development build compiled, launched and PlayerLog logged. Open file. Error is:

NullReferenceException: Object reference not set to an instance of an object at DamageZone.OnTriggerEnter (UnityEngine.Collider other) [0x00090] in E:\game projects\Dungeons Of Futanaria\Assets_script\DamageZone.cs:75

That's rather strange, because the any reference that could be the culprit is very clearly assigned. Which is why it works in the editor. And it is assigned assuming the same principles of logic and consistency that I applied to every other script and bit of code throughout my project, which is why they work and they can be assumed to keep working and not randomly give bogus null reference exceptions. Or so I thought?

I assign the variable in the start method (which is a method I've naively assumed to not be prone to random errors, my bad Unity) like so: alt text

And as an additional precaution I added this to the method that is being claimed 'null reference my ass' in the log file:

alt text

Forgive the crude language, I have been renaming my scripts and variables during the process of trying to debug this and at some point patience kind of runs low.

12323d-4.png (25.5 kB)
2222224.png (40.7 kB)
Comment
Add comment · Show 3
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
avatar image tormentoarmagedoom · Mar 06, 2020 at 10:35 AM 0
Share

Hello.

i really didnt read you post, but for your title, maybe this solve your problem.

Once i had a similar problem because the scripts, in the editor, where executing in different order than in build game. So one variables were null.

Be sure to assign an order of execution for your scripts:

https://docs.unity3d.com/$$anonymous$$anual/class-$$anonymous$$ono$$anonymous$$anager.html

Good Luck!

avatar image monobanana tormentoarmagedoom · Mar 06, 2020 at 11:49 AM 0
Share

But that's incredibly retarded, why would Unity use script execution order 'A' for the editor, but a different order for the build? I cannot imagine the Unity developers being so incredibly moronic that this would be the case.

At the same time I suspect it does have something to do with that. I checked the link and yeah you can set the script execution order for literally everything manually but jesus christ where to even start?

I appreciate the effort though.

avatar image monobanana · Mar 06, 2020 at 10:57 AM 0
Share

But that's incredibly retarded, why would Unity use script execution order 'A' for the editor, but a different order for the build? I cannot imagine the Unity developers being so incredibly moronic that this would be the case.

At the same time I suspect it does have something to do with that. I checked the link and yeah you can set the script execution order for literally everything manually but jesus christ where to even start?

I appreciate the effort though.

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.

Follow this Question

Answers Answers and Comments

203 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

Related Questions

NullReferenceException after build 1 Answer

Unity Build nullReference, but editor sees through it! 1 Answer

Build successful, but does not open 0 Answers

NullReferenceException while raycasting? 0 Answers

Null Reference Exception anytime scene is reloaded? 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