UnityでHTC vive のコントローラーからキューブを発射するようにしたいです。
ですが、生成した後、発射する向きのベクトルの取得方法が不明です。
わかる方がいれば教えていただきたいです。
よろしくお願いします。
var device = SteamVR_Controller.Input((int)trackedObject.index);
//トリガーを引く
if (device.GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
{
var newCube = Instantiate (cube, device.transform.pos, Quaternion.identity);
newCube.GetComponent<Rigidbody>().AddForce("ここにコントローラーの向きのベクトル??");
}
あなたの回答
tips
プレビュー