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 DenisProvost · May 27, 2011 at 07:52 AM · instantiatebugwebplayerassetbundledynamic

Dynamic object Instantiate

Hi everyone !

Despite my searches around the Web I can’t find anything about how to solve a problem i encounter with Unity so I’m posting here, hoping some of you guys will be able to help me.

My problem is when I use either local data or online data in unity everything works just fine but when I try to export to the web player everything collapses.

OK so this is what I do, maybe that will help:

I store a series of objects in a list (List) coming from a loading of asset Bundle i made myself and it seems that’s where the issues comes from. The objects stored in that list are dynamics, they are stored as asset Bundles and not prefabs.

It works pretty well in Unity when I use it in local (local database, resources etc) but when I export to the web player, the instances of the objects are bugged and the player crashes!

the code I use:

 GameObject TempObjAdd = (GameObject) Instantiate(datasM.Addobjet, cible.transform.position, Quaternion.identity) as GameObject;

« datasM.Addobjet » is the object from the list I use.

After several tests, it seems to be rights there at that point of the code but it’s instantiation doesn’t seem to work.

An instance like this one that seems to work just fine in Unity.

 public GameObject ball;
 GameObject TempObjAdd = (GameObject) Instantiate(ball, cible.transform.position, Quaternion.identity) as GameObject;
 

Did some of you guys ever encounter the same problem?

Thanks for helping!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Graham-Dunnett · May 27, 2011 at 09:54 AM

Hard to make any suggestions based on this information. Probably assume that the asset bundle does not contain the object you are loading, so perhaps use:

http://unity3d.com/support/documentation/ScriptReference/AssetBundle.Contains.html

If you need more help, maybe post the script you use to create the asset bundle, and the code you use to load the asset bundle and load the objects from it.

Asset Bundles are a Pro feature.

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 DenisProvost · May 27, 2011 at 08:01 PM 0
Share

Hey, thx for your answer. The thing is that in Unity everything works fine. Assets are loaded and checked before they're instancied so my guess is that it doesn't come from that. I don't get any errors with the code either local or web as long as i'm IN UNITY. The problem really is the export to the webplayer. Note that i load the assetbundle in a list and i don't use them after that in the aplication, only in the item list.

The version i use is 3,0, pro and i use assetbundle on an other part and it works as well online and offline.

Do you know about a way to instanciate an object in the webplayer ? Does it come from the code or from the player itself ?

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

2 People are following this question.

avatar image avatar image

Related Questions

Create an AssetBundle with prefabs containing imported models 0 Answers

Wait for coroutine to finish before returning a value in another function 0 Answers

Unity 3D Keep Crashing in every site! 1 Answer

Changing game object based on variable state? 1 Answer

Assign www.assetBundle to new AssetBundle Freezes WebPlayer 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