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
0
Question by FlashMuller · Jul 08, 2014 at 12:28 PM · editorbuildmaterialasset

Why do my Assets work in Editor and nowhere else?

Hey guys, my problem is quite simple: I have several GameObjects (Cars) that - depending on distance to camera and a "mood"-variable - change their mesh (like LOD) or material. Neither mesh nor material are actually "in the scene": The Spawnpoint GO - placing the cars in the scene - has a List of GameObjects (Cars), which then again have their two meshes and three materials. While playing the cars dynamically change their shared mesh / material. This works fine in Editor and did already worked on devices (!) (e.g. WinRT, Windows Phone 8, Windows 8), but stopped working. When changing the LOD the mesh isn't rendered, when changing the material it becomes pink. This happens on all three platforms outside of the editor. As it is working IN the editor, it shouldn't be a "code-problem." What might be the reason for the differing behaviour? Cheers, Daniel

Comment
Add comment · Show 4
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 DESTRUKTORR · Jul 08, 2014 at 12:30 PM 0
Share

Does it generate any error messages? Also, what do you mean "works in the editor?" Do you mean it works in Play $$anonymous$$ode in the editor? Or do these scripts run in edit mode?

Have you changed anything with the software, like updating Unity?

Also, have you changed devices?

Are you sure that all the assets that are needed are in the right places in the builds you're testing?

avatar image FlashMuller · Jul 08, 2014 at 12:31 PM 0
Share

EDIT: Calling Resources.UnloadUnusedAssets() before entering a level actually solves the problem. Still, the question remains.

avatar image Graham-Dunnett ♦♦ · Jul 08, 2014 at 01:06 PM 0
Share

Pink means that a shader hasn't been loaded, or the shader isn't compatible with the device.

avatar image FlashMuller · Jul 09, 2014 at 07:03 AM 0
Share

Graham, the shader should be compatible. It's the standard $$anonymous$$obile/Diffuse and it has already been working and right now appears to be working from time to time with no changes in the shaders.

DESTRU$$anonymous$$TORR, I don't have any error messages (even on the devices) and everything works fine in Play $$anonymous$$ode in editor. I have been using 3 Platforms and Devices, but these are the same devices, that have already been working.

The only major change was that I have tried Unity Pro License but cancelled my testphase to rule this out. Problem remains with both licenses of Unity. I can't really say if the problem started with the Pro-License as it only happens on the devices and I only test on them from time to time. Additionally I ran an update of Daikon Forge UI - but playing with a disabled UI doesn't change the situation.

What do you mean by "are in the right places?" I didn't move them, they get included in the built (from what I can tell from the Editor.log after building) and they work in the editor.

One more thing I noticed: I happens that in one level I've got access to all materials and meshes(!) and in others don't (within the very same built and ga$$anonymous$$g session)

EDIT: Actually it is random if a level has got these problems or not. During one session in the same built levels either work or don't. It appears to be completely random.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by FlashMuller · Jul 10, 2014 at 06:36 AM

Ok,

so I found a solution to that problem, although I can't explain why the old system stopped working. As a reminder: Resources we're assigned to variables in the editor and then randomly disapppeared. When using Resources.Load during the Start() Routine everything works fine, so there appears to be a big difference between assigning and loading.

Still I don't know why this did work once in the first place. Anyway, Resources.Load() appears to be the right way to get Resources in the scene.

Cheers

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Getting properties on 'missing' things in Editor Scripts? 4 Answers

How to set a shared material in inspector? 0 Answers

Unity editor and inspector header 0 Answers

Script works in Game View, but not in build 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