> For the complete documentation index, see [llms.txt](https://reach-cloud.gitbook.io/reach-explorer-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reach-cloud.gitbook.io/reach-explorer-documentation/metaverse-cloud-engine-sdk/unity-engine-sdk/components/interactions/metaverse-interactable.md).

# Metaverse Interactable

### MetaverseInteractable Documentation

The MetaverseInteractable component allows players to interact with objects on VR and non-VR platforms. It utilizes the Unity XR Interaction Toolkit and derives from XRSimpleInteractable.

#### Namespace

MetaverseCloudEngine.Unity.XR.Components

#### Public Methods

* **void StopNonVRAnimation(string animationName):** Stops the specified non-VR animation if it is playing.
* **void PlayNextNonVRAnimation():** Plays the next available non-VR animation.
* **void PlayNonVRAnimation(string animationName):** Plays the non-VR animation with the specified name.
* **void PlayNonVRAnimation(AvatarPlayableAnimationPreset anim):** Plays the non-VR animation from the specified preset.
* **void ResetNonVRAnimationCooldown():** Resets the non-VR animation cooldown.
* **Vector3 GetInteractPosition(Transform interactableAttachPoint, Transform interactorAttachPoint, bool nonXR):** Gets the target position of this interactable relative to the interactor attach point and interactable attach point.
* **MetaverseInteractableAttachPoint GetBestAttachPoint(bool leftHand, bool firstGrab):** Gets the best attach point for the given hand.
* **void ForceLocalPlayerSelection():** Forces the local player to select this interactable.
* **void ForceDeselection():** Forces this interactable to be deselected by all currently selecting interactors.

#### Public Properties

* **bool AllowMultipleInteractors (read only):** Whether to allow multiple interactors to select this interactable at the same time.
* **bool CanBeStolen:** Whether to allow the player to steal this interactable from another player.
* **bool IsClimbable:** Modifies the behavior of the interactable to be suitable for climbing.
* **bool AllowFlatSurfaceClimbing:** Whether to allow the player to attach to flat surfaces when IsClimbable is true.
* **bool CollideWithPlayer:** Whether to allow the player to collide with the object they're holding.
* **float PhysicsAttachmentBreakDistance:** The maximum distance from the original grab point that the interactor can be before the grab breaks.
* **MetaverseInteractableAttachPoint Hand1AttachPoint (read only):** The primary hand's attach point for this interactable.
* **MetaverseInteractableAttachPoint Hand2AttachPoint (read only):** The secondary hand's attach point for this interactable.

#### Inspector Fields

* **bool canBeStolen:** Whether or not this interactable can be stolen from another player.
* **bool enableRotation:** Whether or not the player can rotate the object while holding it.
* **MetaverseInteractableAttachPoint\[] attachPoints:** Specific attach points for the left and right hands.
* **int nonVRDetachSocketType:** The type of socket to attach this interactable to when it is deselected completely.
* **bool usePhysicsTracking:** Whether or not to use physics-based tracking for VR and non-VR interactors.
* **bool enablePlayerCollision:** Whether or not the player can collide with the object they're holding.
* **float breakDistance:** The maximum distance from the original grab point that the interactor can be before the grab breaks.
* **UnityIkTarget leftHandIKTarget:** The IK target for the left hand when using non-VR interaction.
* **bool nonVRRightHandAim:** Whether or not the right hand should aim at the interactable when using non-VR interaction.
* **int upperBodyStyleID:** The style to use for the character's upper body when using non-VR interaction.
* **UseAnimationSelectMode nonVRAnimationSelectMode:** The selection mode to use for non-VR animations.
* **float nonVRSequenceResetCooldown:** The cooldown time before the non-VR animation sequence is reset.
* **NonVRAnimation\[] nonVRAnimations:** The non-VR animations that can be played on this interactable.

#### Behavior

* **Execution Order:** This class uses the int.MaxValue - 2 execution order, meaning it will be updated after most other components in the scene.

#### Usage

1. To use MetaverseInteractable, start by adding the component to a GameObject in your scene.
2. Configure the various options in the inspector to customize the behavior of your interactable.
3. You can then use the public methods to control the interactable, such as playing animations or forcing selection.

**Example:**

You can use the MetaverseInteractable component to allow players to pick up and throw a ball. To do this:

1. Add the MetaverseInteractable component to the ball GameObject.
2. Ensure that the ball GameObject has a Rigidbody component.
3. Configure the attachPoints property to specify where the player's hands should grab the ball.
4. The player will then be able to pick up and throw the ball using their XR controllers or simulated hands.

#### Additional Notes

* The MetaverseInteractable component is designed to be used with the MetaverseXRController component.
* The MetaverseInteractable component can be used to create a variety of different interactions, such as picking up objects, throwing objects, opening doors, and climbing walls.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://reach-cloud.gitbook.io/reach-explorer-documentation/metaverse-cloud-engine-sdk/unity-engine-sdk/components/interactions/metaverse-interactable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
