LoginSignup
10
9

More than 5 years have passed since last update.

VRTK 3.2.1の基本設定から物を掴むまで

Last updated at Posted at 2018-05-02

まえがき

参考ページの丸写しです。ごめんなさい&ありがとうございます。
なお、自分のメモ用ですので、ご容赦ください。

バージョン

Unity 2017.4.2f2
SteamVR Plugin 1.2.3
VRTK - Virtual Reality Toolkit - [ VR Toolkit ] 3.2.1

基本設定

空オブジェクトVRTK作成
VRTKの子に空オブジェクトLeft, Right. Steam作成
Steamの子に[CameraRig]配置
VRTKにVRTK_SDKManagerをアタッチ
SteamにVRTK_SDKSetupをアタッチ
VRTK_SDKSetupのQuick SelectにSteamVRを設定
VRTK_SDKManagerのAuto Populateをクリック
VRTK_SDKManagerのSDK_OCULUS_AVATAR(not installed)をチェック

コントローラ

VRTK_SDKManagerのScript AliasesにLeft, Rightをアサイン
Left, RightにVRTK_ControllerEventsをアタッチ
Left, RightにVRTK_InteractTouchをアタッチ
Left, RightにVRTK_InteractGrabをアタッチ
Left, RightにRigidbodyをアタッチ
RigidbodyのIs Kinematicをチェック
Left, RightのVRTK_InteractGrabのController Attach PointにLeft, Rightをアサイン

対象物

対象物にVRTK_InteractableObjectをアタッチ
VRTK_InteractableObjectのIs GrabbableとIs Usableをチェック
対象物にVRTK_FixedJointGrabAttachをアタッチ
VRTK_FixedJointGrabAttachのPrecision Grabをチェック
対象物にRigidbodyをアタッチ※

※対象物を掴んで離した後の挙動

空中でピタッと止めたい場合はIs Kinematicを有効
無重力感を出す場合はUse GravityとIs Kinematicを無効

その他

掴んで移動してると何かに引っかかって落ちるのが嫌な場合
→対象物のVRTK_FixedJointGrabAttachのBreak Forceを無限に設定
持ち換えたい場合
→VRTK_SwapControllerGrabActionをアタッチ

参考

http://maplesyrup-cs6.hatenablog.com/entry/2017/10/05/235958
http://maplesyrup-cs6.hatenablog.com/entry/2017/12/12/173811
http://dasutio.hatenablog.com/entry/2018/01/20/234425

10
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
9