Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkTransport.GetAssetId

public static string GetAssetId(GameObject go);

Parameters

go Target game object to get asset Id for.

Returns

string The assetId of the game object's prefab.

Description

The UNet spawning system uses assetIds to identify how spawn remote objects. This function allows you to get the assetId for the prefab associated with an object.