How can I get AssetId for spawnable object, that came in an AssetBundle
Here is the situation: I have some AssetBundles with prefabs (GameObjects). I want to spawn them in through the network (NetworkServer.Spawn(go)). So I register them on a client (ClientScene.RegisterPrefab(prefab)) and spawning give me an error on a client side "Failed to spawn server object, assetId=ca1770f47edb46c40935df64801824ee netId=3 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()". AssetId always the same for one prefab.
When I register and spawn prefab with this assetId, everything works fine. It doesn't work, when I set some other assetId. Somehow UNET knows, what assetId I should use.
So the question is: How can I get this assetId?
Answer by mr_okk · Apr 26, 2017 at 11:25 AM
So, if somebody wants to know, the answer is:
Unity editor has a bug. You need certain assetId to register and spawn loaded from assetBundle gameObject. But when you build and run your game outside of the editor, everything will work fine without any additional assetId, just register and spawn it.
Answer by Togias · Apr 05, 2019 at 07:29 AM
Hello, I have the same issue. Did you manage to find a way to spawn the asset bundles in the editor?
Also, I have nested objects with network id's in my asset bundle hierarchy and not having the editor creates a lot of issues on figuring out how to spawn the nested objects. Tank you
Your answer
Follow this Question
Related Questions
Assets Bundle size increases after download 0 Answers
unity3d Network Instantiate from Assetbundle 0 Answers
Spawn with local authority 0 Answers
using networking to create a Splitscreen game on 1 PC ? 0 Answers
Networked movement using navmesh agent 0 Answers