click-target

作成者: facebook

XR内でターゲットオブジェクトを検索してクリックします。UI操作のテスト、ボタンのクリック、インタラクティブ要素の動作確認に使用します。

npx skills add https://github.com/facebook/immersive-web-sdk --skill click-target

Click Target in XR

Find a target object in the scene and click it using a controller, then verify the click registered.

Arguments

$ARGUMENTS should be a description of the target to find (e.g., "the RESTART button", "the scoreboard", "the settings panel").

Workflow

1. Get Scene Hierarchy

Use mcp__iwsdk-dev-mcp__scene_get_runtime_hierarchy to find the target object's UUID.

  • Look for objects with entityIndex (these are ECS entities)
  • PanelUI elements typically have nested children for their content

2. Get Target Transform

Use mcp__iwsdk-dev-mcp__scene_get_object_transform with the target UUID.

  • Use positionRelativeToXROrigin for all positioning operations
  • Note the position for the next steps

3. Position Headset to Look at Target

Use mcp__iwsdk-dev-mcp__xr_look_at with device headset and the target position.

  • This orients the headset to face the target

4. Screenshot to Verify Target Visible

Use mcp__iwsdk-dev-mcp__browser_screenshot to verify:

  • Target is visible in the view
  • Target is not occluded by other objects
  • If not visible, use mcp__iwsdk-dev-mcp__xr_look_at with moveToDistance to get closer

5. Position Controller

Use mcp__iwsdk-dev-mcp__xr_get_transform to check controller position.

  • If controller is visible in screenshot and not occluding target, proceed
  • If controller is far away or not visible:
    1. Get headset position with mcp__iwsdk-dev-mcp__xr_get_transform
    2. Set controller to headset position with mcp__iwsdk-dev-mcp__xr_set_transform
    3. Micro-adjust: offset x by +0.25 (right) or -0.25 (left), y by -0.1, z by -0.3

6. Point Controller at Target

Use mcp__iwsdk-dev-mcp__xr_look_at with the controller device and target position.

  • For UI elements on panels, you may need to target a specific child element
  • If the target is a button on a panel, the button may be offset from the panel center

7. Click

Use mcp__iwsdk-dev-mcp__xr_select with the controller device.

8. Verify Click

Use mcp__iwsdk-dev-mcp__browser_get_console_logs with a pattern to check for expected log messages.

  • If no logs match, the click may have missed - adjust target position and retry
  • Common adjustments: change x or z by 0.05-0.1 to hit child elements

Tips

  • For PanelUI buttons, the button position is often offset from the panel center
  • Use mcp__iwsdk-dev-mcp__scene_get_object_transform on child elements to find exact button positions
  • Always verify with console logs rather than assuming from visuals
  • The ray visual in screenshots can be misleading - test with actual clicks
  • Either controller (left or right) can be used

Example

To click the RESTART button on the pong scoreboard:

  1. Find scoreboard entity (entityIndex 6 in the pong game)
  2. Scoreboard is at (0, -0.798, -1.25)
  3. Button is at approximately (0.05, -0.798, -1.109) - offset toward player
  4. Point controller at button position and click
  5. Verify "[BUTTON CLICKED]" appears in console logs

facebookのその他のスキル

binary-size-analysis
facebook
gitコミット範囲にわたるhermesvm共有ライブラリのコミットごとのバイナリサイズ変更を分析します。コミットごとのサイズと、顕著な増加・減少の要約表を含むマークダウンレポートを生成します。
official
modify-jsi-features
facebook
JavaScript Interface(JSI)レイヤーに新しいJSI機能を追加するためのガイド。ユーザーが新しいメソッドや機能の追加、作成、実装を依頼した際に使用します。
official
non-interactive-git-rebase
facebook
最上位のコミットではないgitコミットの並び替え、分割、削除、修正を、インタラクティブエディタを使わずに行う必要がある場合に使用します。プログラムによるリベースをカバーします…
official
iwsdk-planner
facebook
IWSDKプロジェクト計画とベストプラクティスガイド。新しいIWSDK機能の計画、システム/コンポーネントの設計、IWSDKコードアーキテクチャのレビュー、またはその際に使用します。
official
iwsdk-ui-panel
facebook
IWSDK UIパネルを効率的に開発・反復改善します。PanelUIコンポーネントの作業、UIレイアウトのデバッグ、またはIWSDKアプリケーションにおけるUIデザインの改善に使用します。
official
test-all
facebook
並列テストオーケストレーター。Taskサブエージェントとiwsdk CLIを介して9つのテストスイートすべてを同時に実行します。ビルド、サンプルセットアップ、開発サーバー、エージェント起動などを処理します。
official
test-audio
facebook
iwsdk CLIを使用して、オーディオの例(AudioSourceの読み込み、再生状態、停止、空間オーディオ)に対するオーディオシステムのテストを行います。
official
test-ecs-core
facebook
ECSコア機能(システム登録、コンポーネント、Transform同期、一時停止/ステップ/再開、システム切り替え、エンティティ発見、スナップショット)をpoke…に対してテストする
official