Network State Modules
Last updated
Last updated
Network State Modules are scripts that manage the synchronization of objects and values between multiple users in an ENGAGE session. The most commonly used Network State Modules are as follows:
Network State Module_Transform
Network State Module_AFX Bool
Network State Module_AFX Float
Network State Module_AFX Int
In each case, you add a reference to a transform object or a variable component to the Network State Module, and then the module ensures that the referenced object or component is synchronized between all users.
You can use a Network State Module_Transform
script to synchronize object transformations between multiple users in an ENGAGE session. A single module can synchronize multiple transforms.
To use a Network State Module_Transform
script, complete the following steps:
Select a game object. This game object can include one of the transforms that you want to synchronize, but it isn't a requirement.
In the Inspector panel, add a Network State Module_Transform
script.
Optional: If the game object will be included in a location, enter a value in the Unique ID field. The value must be unique within the Unity scene.
Optional: If you want changes to the transforms to be include in recordings, select the Recordable check box.
For each transform that you want to synchronize, complete the following steps:
In the Transforms list, select the plus symbol to add a new item.
Configure the settings as required. For more information, see Transform Network State Module settings.
Drag the game object that you want to synchronize a transform for onto the Transform field.
Optional: If the game object will be part of an IFX, complete the additional steps described in Using Network State Modules in IFX.
The following settings are available for each transform that you want to synchronize.
Interpolate
If selected, when the ENGAGE application receives a new transform object from the network, it will perform a linear interpolation from the old transform values to the new values over multiple frames. If cleared, the new transform values immediately replace the old values. We recommend that you always select this value so that transitions are more smooth and natural.
Network Sensitivity
Leave at the default value.
Network Position
If selected, the position component of the transform is synchronized across the network.
Network Rotation
If selected, the rotation component of the transform is synchronized across the network.
Network Scale
If selected, the scale component of the transform is synchronized across the network.
Transform
Reference to the transform that you want to synchronize.
The Boolean, integer, and float versions of Network State Module scripts have a similar structure and usage. You can use them to synchronize the value stored in a variable component between multiple users in an ENGAGE session. A single module can synchronize multiple variable components of the same type.
To use a variable component network state module script, complete the following steps:
Select a game object. This game object can include one of the variable components that you want to synchronize, but it isn't a requirement.
In the Inspector panel, add the required network state module script. You can choose either a Boolean, integer, or float version.
Optional: If the game object will be included in a location, enter a value in the Unique ID field. The value must be unique within the Unity scene.
Optional: If you want values changes to be include in recordings, select the Recordable check box.
For each variable component that you want to synchronize, complete the following steps:
In the Afx <type> list, select the plus symbol to add a new item.
Drag the game object that includes the variable component onto the Element field.
Optional: If the game object will be part of an IFX, complete the additional steps described in Using Network State Modules in IFX.
If you use Network State Module scripts to synchronize objects or values in IFX, complete the following additional steps:
Add an IFX Network States Effect
script to the root game object in the IFX.
In the Network State Modules list of the IFX Network States Effect
script, add a reference to each Network State Module used in the IFX.
The following image shows an example configuration: