• 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
0
Question by therussmorris · Dec 01, 2009 at 01:20 PM · build-error

Script works in editor - not in build

Okay, yes I know, this again..but what I've come across via the forum and here, doens't really help me...

Most suggestions point towards reimporting everything...remaking the objects and applying everything, but it always comes back to the same point...working perfectly in the editor..no errors..build, nothing wrong in the log files..then it just doesn't work in the build.

I'm having an issue with the Flocking script in particular. I've re imported everything.. gone through the process of remaking the gameobjects.

The biggest issue I'm having though that the script doesn't even work in a build that's compiled straight from the demo that is supplied, so could it be an issue with unity players and this particular script? I haven't come across a similar issue, so its strange that it happens with this...

The package can be found here... http://www.unifycommunity.com/wiki/images/1/12/Flocking.unityPackage.zip

I guess what I'm asking is this, could someone with 5 minutes try and build from the boid demo and see if it works in a standalone player?

I've AppZapped unity, redownloaded, reinstalled, reimported, checked the build log, which it appears as using 1kb (or similar) and 0.0% of resources, so 'something' is loading, but that data amount is the lowest it could be without being nothing...

Thats all I have to go on

thanks again, Russ.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by duck · Dec 01, 2009 at 02:51 PM

I just downloaded the package. I created a new Unity project with no standard assets included. Imported your package, built a stand alone windows EXE, and it worked fine.

I could see the black objects flying around in the standalone build.

This was using Unity 2.6 on Windows XP SP3. The only errors I can see are about inconsistent line endings in "Boid Flocking.js" and "Boid Controller.js", which you should probably fix just to rule that out, but shouldn't be causing the problems you've described.

Also, it's generally not a good idea to use spaces in your script names, because these translate directly to the MonoBehaviour class names which shouldn't have spaces in. Again, I don't think this should be causing the problems you've described, but it might be worth fixing just to rule it out.

Comment
Add comment · Show 1 · Share
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 therussmorris · Dec 01, 2009 at 03:10 PM 0
Share

thanks for that.

I've been through the names and spaces and stuff already, and it didn't seem to do anything... I'm using $$anonymous$$ac though, but it shouldn't be any different.... I think I might just go through it with a metaphorical fine tooth comb...

avatar image
1

Answer by therussmorris · Dec 01, 2009 at 08:22 PM

For reference purposes, I ended up solving this... it's quite embarrassing really...

About 2 weeks ago I decided to clean up my project hierarchy, moving things around, putting things in specific folders etc... this seems to have been the problem.

I noticed that all 'original' scripts (that 'come' with Unity) ran fine, it was everything that I've added since which didn't..

I moved everything into the standard assets folder, with all the 'working' scripts, as I assumed if they're being called from there, it shouldn't be an issue...

a quick build later and everything worked.

thanks for the suggestions though, it helps with ruling out certain possibilities!

Comment
Add comment · Show 1 · Share
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 Michael La Voie · Dec 02, 2009 at 07:58 PM 0
Share
  • for honesty! I've done the same type of thing.

avatar image
0

Answer by JeroenAnimator · Sep 17, 2012 at 09:36 PM

Okay about the namespaces. NEVER use namespaces in Script filenames if you are targeting Flash. My scripts with namespaces worked in webplayer and stand-alone but not in FlashBuilds.

Comment
Add comment · Share
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

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

1 Person is following this question.

avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How can I stop the variable values reverting to its default values after being built? 1 Answer

Why won't unity remote 4 work for me? 0 Answers

windows sdk installed but get error 1 Answer

Android build error unity 5.4 b15 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