Spawning objects from AssetBundle

Hello everyone!

Maybe someone did such task and can suggest some solution.
I have two projects (i have more, but for this topic only two is important), first is a game client, second is for weapons.
From second I build bundles with weapon prefabs. I want to use them in my game, but here is a little (maybe not so little) problem:
I receive bundles, read information, register weapon with ClientScene.Register(weapon) and try to spawn it on server NetworkServer.Spawn(obj).
In such case i have an error on a client: Failed to spawn server object, assetId=ca1770f47edb46c40935df64801824ee netId=3 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate().

If I register object with assetId from this error (ClientScene.Register(weapon, assetId)), everything works fine. When assetId have any difference, nothing is spawning.

Does someone know, how can I get right assetId? Or is there another way to spawn such objects.

I have same issue, and my solution is write a editor to serialize assetId, and register when load asset.
You can get assetId with NetworkIdentity.assetId :slight_smile:

Does assign a assetID during spawn overcomes that error?