5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OculusGoでGazePointerがuGUIではなく、その奥のオブジェクトを指してしまう問題

Posted at

現象

OculusGoのプロジェクトで、OVRRaycasterとOVRPhysicsRaycasterを利用するとき、手前にCanvas(uGUI要素)を置いても奥にあるオブジェクトにGazaPointerが表示されてしまい、クリック等のイベントも奥にあるオブジェクトに対して発生してしまう。

また、メニューをレーザーポインターの光線が貫通しないようにBoxColliderをアタッチするとメニューのボタンが押せなくなる。

環境: Unity 2018.1.5f1 (64-bit) / OculusUtilities(1.26.0 2018/06/20)

原因

OVRPhysicsRaycaster.sortOrder が OVRRaycaster.sortOrder よりも大きいため、OVRPhysicsRaycasterで指されるオブジェクトが優先されている。


OVRPhysicsRaycaster.sortOrder の既定値は20
OVRRaycaster.sortOrder の既定値は0
……なので、何も設定しないと上のような状態になってしまう。

対策

OVRPhysicsRaycaster.sortOrder を -1 に設定してやる。

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?