Network ID
Used to Identify a GameObject in a networked game.
Last updated
Was this helpful?
Used to Identify a GameObject in a networked game.
Last updated
Was this helpful?
Name
Function
ID
Automatically assign at run time.
OwnerRemotePlayerId
The owner's full playerId.
OwnerCustomPlayerId
The owner's custom playerId.
Type
Player: Player controlled GameObject
Non-Player: Non-player controlled GameObject
SendRealtimeData
Indicates whether the Networked GameObject sends Realtime data to the game server. Only controls the behaviour of non-player networked GameObjects
DynamicallySpawned
Disable this for non-player Networked GameObjects that are not spawned/destroyed by the SceneSpawner.
FixedNetworkObjectID
The Fixed NetworkObjectID of the non-player Networked GameObject that are not spawned/destroyed by the SceneSpawner.
A valid FixedNetworkObjectIDs should be between 1-4999
Filterable
Indicates whether the GameObject can be filtered by the realtime filter. Only controls the behaviour of player networked GameObjects
Visible Size
Size of the bounding box of the GameObject
Find out if local player is the owner of a Networked GameObject
Removes the networked GameObject across the network. The optional parameter specifies the amount of delay in seconds before destroying the networked GameObject.
Only the GameObjects that the local player owns should receive input updates.
In this example, networkId.IsMine is called to find out if the local player has the authority to move the GameObject.
Answer: If players leave temporarily and reconnect back to the rooms, you probably want to use a longer to create rooms. So players don't get removed from rooms too quickly.
If the first player went offline and reconnect back to the room game server before the room is over, the room game server still remembers the player's roomPlayerID(which is 1 in this case). so the player will gain ownership of the GameObjects with ID in the 100-199 range. If the first player went offline for too long and got kicked by the room keeper, the player's roomPlayerID will be recycled and appended to the end of the available roomPlayerID queue. So if the player joins the same room again, a new roomPlayerID will be assigned. Say the new roomPlayerID is 3, the player will create new sets of GameObjects and own GameObjects with ID in the 300-399 range.