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 tsx5000 · Dec 03, 2014 at 02:15 PM · assetbundlesscene loadscript loading

Loading scenes and scripts through assetBundles

I am making a social world game similar to simcity. On clicking on each building a mini game starts. Is it possible to have the mini game in a separate scene which can be downloaded through an assetbundle.

I have tried the example given in Unity docs, but I get a referencing warning on the gameObjects with scripts on them, when they are loaded in the scene.

Any idea on how this can be done ?

EDIT : Here is the code I am using to build the scene into an asset bundle...

 [MenuItem ("Assets/BuildWebplayerStreamed")]
     static void MyBuild(){
         string[] levels  = new string[]{"Assets/Scene/AssetTest.unity"};
         BuildPipeline.BuildStreamedSceneAssetBundle( levels, "SceneTest.unity3d", BuildTarget.WebPlayer); 
     }

This is used to load the scene : public string url = "http://192.168.1.113:8000/SceneTest.unity3d";

     IEnumerator Start () {
         WWW www = WWW.LoadFromCacheOrDownload(url,1);
         yield return www;
         
         var asset = www.assetBundle;
         Application.LoadLevel("AssetTest");    
     }

The scene contains 2 gameOBjects; a plane and a sphere. The sphere has a script on it which is missing a reference when loaded into the scene.

Comment
Add comment · Show 2
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 HarshadK · Dec 03, 2014 at 02:19 PM 0
Share

Can you share your existing script so that we can guide you in the right direction? Sometimes it can be that you are actually doing it right but a few $$anonymous$$or errors can make you believe you are doing it wrong and can set you on a different path.

You can also provide some information as to how you have set your assetbundles and how you have implemented your thing.

avatar image tsx5000 · Dec 04, 2014 at 06:31 AM 0
Share

Added the sample code which I am using to test this.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SaraCecilia · Dec 04, 2014 at 02:39 PM

http://answers.unity3d.com/questions/44013/refenced-script-on-this-behavior-is-missing.html

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 tsx5000 · Dec 09, 2014 at 01:21 PM 0
Share

I already know the reason why I am getting the referencing error. $$anonymous$$y question was how to assign the scripts for each object within the scene.

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

26 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

Related Questions

Working example of loading scene as asset bundle in Android!? 0 Answers

Any way to stream 3D GameObjects on Unity Basic? 0 Answers

Asset bundles caching.IsversionCached() always returns false 1 Answer

Asset Bundle Dependencies, Unity 5 0 Answers

Default Sprite Shader is missing from prefab loaded from asset bundle? 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