Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by Revontuli · Jan 29, 2014 at 12:26 AM · game editor

Game runs in Editor, Crashes in Build, CharacterMotor.js seems to blame

Short Version: Game runs in editor fine. Game crashes while starting up if when running as a build, with very little warning or information. Removing a slightly modified version of CharacterMotor.js stops the crash, but this source file is needed for the game to run properly.

Longer Version: A Unity project I’m working on seems to be having (recent) trouble running a build with a modified CharacterMotor.js.

Running the game in the editor works great, but when I try to run a build (Windows 7) the game crashes as it loads, rarely giving any notice in the output log.

Most of the time the error log has said little to nothing, but stripping down the project I did manage to get some information dumped. The dump file describes an error (which is vague, I know, a generic memory access fault):


Process Architecture: x86 Exception Code: 0xC0000005

Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.


This is about the most I can get out of the error log, although I think I can get a bit more information on the stack at time-of-crash. It took a week of trial and error to narrow down the problem file to CharacterMotor.js, as there is no error log or indication that anything is wrong until the crash itself.

The game runs fine in the editor, and only crashes if I try to run a build (one reason I do not know exactly when this started happening). My best guess would be for time would be after one of the more recent updates, like v4.1 or v4.2.

I’ve been working on this project for quite a while (since version 3.5) – I’ve done many working builds in the past. I’m running v4.3.3f1 currently, but I have been having this issue for a while now.

I narrowed the trouble down to CharacterMotor.js – If I remove it, the game runs (it doesn’t run well, obviously, giving me a ton of errors, but at least the executable doesn’t crash).

If I re-import CharacterMotor, the application will run. The problem is, I’ve customized the script and added new code to it. Adding in any new executable lines of code to CharacterMotor (even a simple variable declaration by itself) will cause the application to crash.

The crashing is not limited to one machine – I’ve tried building on a few computers, with pretty much the same result. I also wonder if it’s CharacterMotor specifically, or if that just happened to be an unlucky file that the build process ends up corrupting. A long session of trial and error suggests that this is the file that’s causing the crash, though.

I’ve heard of similar (but not identical) circumstances where CharacterMotor was corrupted, but most of the “easy” solutions I’ve read do not seem to work. Reimporting All does not do anything. I tried a simple replace-file-with-identical-one trick that was recommended, to no effect.

I haven’t done anything incredibly drastic yet (like c# translation, or making a new script type to replace CharacterMotor) as CharacterMotor touches a lot of other source files, so I want to make sure there is nothing else I can try before embarking on what looks to be very nasty code surgery (especially if I’m not sure it will fix what the problem is…)

I’m running Windows 7 (service pack 1), and Unity v4.3.3. Let me know if there is any further information I can give that could help.

Comment
Add comment · Show 1
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 Revontuli · Jan 31, 2014 at 03:53 AM 1
Share

Solved it - and boy is my face is red

An old file (named differently) defined a Character$$anonymous$$otor object in code, this along with the customized one created a conflict.

An easy fix, once I knew what the problem was - the thing is, I even found this advice in the forums, but overlooked that this file was still in the project!

The file was not being used in the scene, and only crashed the system when a built version was run.

Thank you for your response - stripping the build down to prepare it for uploading is what led me to find the problem file.

So let that be a lesson - don't copy and paste files around that share the same class name! And if your build crashes unexpectedly, quadruple-check to make sure you are not redundantly defining classes!

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

18 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

Related Questions

Create a in-App Purchases for Android? 0 Answers

Random Spawnpoints 1 Answer

Aplication.LoadLevel isn't working in built version 2 Answers

Why does my player moves to the top of his capsule collider? 1 Answer

Using C++ libraries for Editor extensions 0 Answers


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