Version: 2019.1 (switch to 2018.3 or 2017.4)
LanguageEnglish
  • C#
Removed in version 2019.1.0

Network.AllocateViewID

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Obsolete public static NetworkViewID AllocateViewID();

Description

Query for the next available network view ID number and allocate it (reserve).

This number can then be assigned to the network view of an instantiated object. The example below demonstrates a simple method to do this. Note that for this to work there must be a NetworkView attached to the object which has this script and it must have the script as its observed property. There must be a Cube Prefab present also with a NetworkView which watches something (like the Transform of the Cube). The cubePrefab variable in the script must be set to that cube Prefab. This is the simplest method of using AllocateViewID intelligently. This get more complicated if there were more than one NetworkView attached to the Cube which is to be instantiated.

Did you find this page useful? Please give it a rating: