[Interaction Setting - InputOVR]
1. Hierarchy에 InputOVR을 추가한다.
*InputOVR을 못찾겠거나 InputOVR이 있지만 비어있으면 아래 블로그 글을 참고하자.
[Unity][Trial&Error] Assets에서 InputOVR이 없는 문제.
Problem: Oculus Integration를 다운로드하고 import까지 했는데 InputOVR이 안보임. Solution: Oculus Integration을 재다운로드 및 import [Window > Package Manager]에서 Oculus Integration을 찾고 Re-Download 후 Import한다. 그렇다
gycblog.tistory.com
[Unity][Trial&Error] InputOVR이 비어있는 문제
Problem: InputOVR이 비어있음. = Component들과 Child Game Object들이 없음. Solution: 아래보고 따라하자. 예전에 InputOVR을 사용했을 때는 component들과 child game object들이 잘 들어가 있었는데, 버전이 달라서 그
gycblog.tistory.com
3. InputOVR에 Controllers를 추가한다.
4. [OVRPlayerController > OVRCameraRig]에 InteractionOVRCameraRig 스크립트를 추가한다.
5. InputOVR의 OVR Camera Rig Ref 스크립트의 Ovr Camera Rig에 OVRCameraRig를 reference한다.
6. Controllers와 그 Child Game Object들의 Inspector 설정을 다음 사진들과 같이 설정한다. (아마 따로 설정 안해도 다 되어있을 것임.)
더보기 Click



InputOVR setting을 모두 마친 InputOVR의 모습은 다음 사진과 같다.
Oculus의 Hand Tracking Interaction을 사용하려면 Controllers 대신 Hands를 추가하여 설정하면 되는데, 이 부분은 여기서 다루지 않을 예정이다.
[Interaction Setting - Grab]
1. [InputOVR > Controllers > Left/Right Controller > ControllerInteractors]에 각각 ControllerGrabInteractor를 추가한다.
2. Grab 하고자 하는 Game Object를 추가한다. (여기서는 cube라고 가정함.)
3. Cube에 Rigidbody를 추가한다.
4. Cube에 Grabbable 컴포넌트를 추가한다.
5. Cube에 Grab Interactable 컴포넌트를 추가한다.
6. Grab Interactable의 Rigidbody 항목에 Cube의 Rigidbody 컴포넌트를 reference한다.
7. Grab Interactable의 Pointable Element 항목에 Cube의 Grabbable 컴포넌트를 reference한다.
8. Grab 성공!
위 사진처럼 컨트롤러에 구체가 붙어있는 것을 볼 수 있다. 빨간 cube는 grabbable object로,
이렇게 컨트롤러의 구체가 grabbable object에 닿으면 파랗게 변해서 grab할 수 있는 상태가 되고,
실제로 grab을 하면 초록색으로 변하여 grab해서 cube를 들고 움직일 수 있다!
'Unity > Dev' 카테고리의 다른 글
[Unity] Light Probe로 자연스러운 빛과 실시간 그림자 연출하기 (1) | 2023.01.18 |
---|---|
[Unity] UI Scripting Automation (2) (0) | 2023.01.17 |
[Unity] UI Scripting Automation (1) (0) | 2023.01.17 |
[Unity] 물 속에서 grab하면 물 구체가 잡히는 interaction 구현하기 (1) (0) | 2023.01.16 |
[Unity] VR Player Controller with Oculus Integration SDK (0) | 2023.01.12 |