การฝึกอบรม
โมดูล
Getting started with 3D object interaction - Training
This course will provide steps and procedures to follow on how to manipulate and interact with 3D objects.
เบราว์เซอร์นี้ไม่ได้รับการสนับสนุนอีกต่อไป
อัปเกรดเป็น Microsoft Edge เพื่อใช้ประโยชน์จากคุณลักษณะล่าสุด เช่น การอัปเดตความปลอดภัยและการสนับสนุนด้านเทคนิค
Mesh Interactables is a system for configuring objects with Unity scripts that defines interaction with an object or avatar behavior at runtime. The scripts define the properties of the object that can be interacted with using XRI interactors. The Mesh toolkit contains scripts of different object types that can be defined. When a project runs, it sets up all the necessary prefabs and settings required for objects or the avatar to behave as defined. If you'd like to see an approximate preview of what your interactable objects will look and feel like when they run in the Mesh app, be sure to set up Play Mode with Mesh Emulation. Note that the IK functionality seen in the Mesh app isn't available in Play Mode with Mesh Emulation.
To make an object interactable, you must add the Mesh Interactable Setup component.
In the Hierarchy, select the object.
In the Inspector, click the Add Component button and then select Mesh Interactable Setup.
The component is added with its default Interactable Type property set to Basic. (Object types will be explained in the next section.)
The properties for a group of objects that all behave the same can be set up with a parent Mesh Interactable Setup component. The properties will be applied to all children with rigidbodies at runtime by automatically adding a Mesh Interactable Body component to each child object. You may want to add Mesh Interactable Body manually to use Mesh interactables with Visual Scripting, such as with interaction events or to modify the manipulable target transform through the visual script.
Notes:
Mesh Interactable Body will allow each interactable to behave independently.
A rigidbody must be added to an object if you want it to be physics enabled.
In the Mesh Interactables Setup and Mesh Interactable Body components, you can click the "?" button to navigate to a page in the Mesh documentation that contains help for the feature the button is connected to.
There are four object types:
To choose an object type:
As mentioned above, this is the default type. When the user hovers over or selects the object, it can invoke callbacks and other scripts can react. For example, if you have a button that you want to use to enable another object, add this Interactable type to the button with an OnSelected callback to enable that other object. The button will be fully interactable just by adding this type and a collider; you won't have to do anything else.
Note: The other three Interactable types--Manipulable, Equippable, and Throwable (explained below), have the same attributes as the Basic type but with additional features.
Learn more about Basic object type settings
You can move an object of this type from a distance; specifically, you manipulate its transform at runtime and move it through space on the end of an interactor ray. Shortcut controls are available to rotate or translate the object. For manipulation of objects in the Mesh app, you can turn on IK settings for the avatar hand to follow the object. Manipulable objects don't require a rigidbody, but you should add one if you want the objects to have physics capabilities.
Learn more about Manipulable object type settings
You can grab an object of this type. In Mesh terms, we say that you "equip" the object to your avatar's hand. To equip an object on the PC, click the object or press F while the object is selected. To equip an object on the Quest, press the 'Grip' button while the object is selected. Equippable objects contain settings for IK targets for your avatar's arm pose while the object is equipped. The IK targets are an offset from the avatar's chest; this determines where the hand goes while the object is held or activated.
Learn more about Equippable object type settings
As the name implies, you can grab and throw an object of this type. After grabbing, you can enter aim mode by pressing and holding the left mouse button. This will allow your avatar's arm to follow your mouse target; to throw the object, release the left mouse button.
Learn more about Throwable object type settings
All the Interactables components have interaction properties and methods available to Visual Scripting so you have an unlimited amount of ways to make them work together. To take advantage of this, use the Mesh Interactable Body component inside a script graph with a node to an available property, such as OnHovered or OnSelected, hooked up to an OnStateChanged node. For example, the following script graph will enable the cylinder while the button is pressed and disable it when the button is released. The button is fully interactable just by adding the script and a collider; you don't have to do anything else.
For all interactable bodies:
For Equippables:
For manipulables to modify the Target Position:
การฝึกอบรม
โมดูล
Getting started with 3D object interaction - Training
This course will provide steps and procedures to follow on how to manipulate and interact with 3D objects.
เอกสาร
Triggers, anchors and tethers - Microsoft Mesh
Learn how to anchor an avatar inside an object's trigger volume and tether an object to an avator's transform.
Create avatar spawn and Travel Points - Microsoft Mesh
Learn how to create points that an avatar will spawn to or travel to when using teleportation.
Understanding Interactable components and scripts - Microsoft Mesh
Learn about what makes interactable objects in the Mesh Pavilion sample work.