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 /
avatar image
0
Question by grzesiu10 · Dec 02, 2015 at 08:41 PM · androidscripting problemeditorbuildbug-perhaps

Script works in editor, but does not work in build (Android)

I've made script that actives or deactives child gameobjects. It works fine in editor but when I build settings and put it on my phone, it doesn't, just nothing happens. There are no errors in the editor, neither on runtime nor after build is done. I have no clue why. Any possible reasons?

Script: http://pastebin.com/ewJbyRpb

Comment
Add comment · Show 6
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 Jessespike · Dec 02, 2015 at 09:45 PM 0
Share
  PlayerPrefs.GetString("skinName")

Do you ever call SetString("skinName") in a different script? Cause I don't see it anywhere, and you have no default value set for GetString.

If that's not the problem, then you can add Debug.Logs and use logcat to pinpoint the problem.

avatar image grzesiu10 Jessespike · Dec 02, 2015 at 10:57 PM 0
Share

Yes, "skinName" is called in another script. How can I use logcat?

avatar image jprocha101 · Dec 03, 2015 at 05:57 AM 0
Share

Sometimes in a build the scripts are not executed in the same order. So Start and Awake in CharacterPresentation might be called before you are setting skinName. You can set the script execution order to make sure they execute in the correct order.

Also, rememember that GameObject.Find does not find inactive game objects.

avatar image grzesiu10 jprocha101 · Dec 03, 2015 at 08:31 AM 0
Share

What method should I use to find inactive gameobjects?

avatar image jprocha101 grzesiu10 · Dec 04, 2015 at 10:32 PM 0
Share

Create a public variable then assign it in the inspector. That is better for performance as well as opposed to using Find statements.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Arshia001 · Dec 04, 2015 at 06:31 PM

I'd bet this is due to some sort of exception. Put a log visualizer into your project, and scan the log for errors or exceptions.

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.

Follow this Question

Answers Answers and Comments

43 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

Related Questions

Unity not compiling script changes 2 Answers

Weird errors pop up when I want to build my game for android 0 Answers

Android build not installing 1 Answer

Script works in Game View, but not in build 0 Answers

Unity Builds Old Version of my Scene 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