Adding grabable objects to a location
Last updated
Last updated
You can add objects to your scene that users on VR devices can pick up and interact with. For example, you could add coffee cup props to a café scene, or throwable balls for a carnival game. We refer to these as network objects, because the object's position and rotation is synchronized across the network. This ensures that when one user in a Session grabs the object, all other users see it's updated position and rotation.
For each individual network object, use the hierarchy shown in the following diagram.
In the parent game object (NetworkObject_1 in this example), add an Engage_Create Network Object From Scene Object
script component. You must use a scale of (1, 1, 1) for the parent game object.
Add the 3D model that you want to use for the network object as a child (NetworkObject_1_geometry in this example).
Ensure that the child object has a Collider component.
You may want to include a method to reset the location of your network objects. For more information see Resetting network objects with a button and Resetting network objects when out of bounds.
The parameters that you can set in the Engage_Create Network Object From Scene Object
script are described in the following table.
Very Unique Object Name
Required Enter a name that is unique in the scene.
Gravity Enabled
If selected, the network object responds to gravity and falls to the first collidable surface when not held.
Always Kinematic
If selected, the network object is not affected by physics. When not held, the object will remain floating at the position where it was left. For more information, refer to Introduction to rigid body physics in the Unity documentation.
Optional String for Games
String that can be applied and used for interactive games
Dont Change Tag
When the network object is created, a Bones
tag is applied to help the application manage the object. If this option is selected, that tag is not applied.
Allow Self Collision
If selected, the object will collide with other network objects.
Allow Recording
If selected, when a user creates a recording in the ENGAGE application, the motion of the network object will be included in that recording.
Dont Change Layer
Caution. Advanced usage only. When the network object is created, it is assigned to a layer that helps the application manage the object. If this option is selected, the object is not moved to that layer.
Single User No Sync
Caution. Advanced usage only. If selected, the object's position is not synchronized between users in a Session. Each user will see their own, independent object.
On Owner Changed is Owner
Caution. Advanced usage only.
You can define methods to call when the object's owner changes. Network objects are owned by the user that grabs them. A Boolean parameter is passed to the methods, which is true
if the local user is the owner.