Aiming SteamVR_LaserPointer with head camera, clicking with controller?
Hello,
I'm doing sort of UX experimenting and I would like to be able to aim with the laser pointer, but still be able to do clicking with my controller. I'm pretty much a novice to Unity.
I've implemented this solution and it works fine when I attach it to my controllers (in [CameraRig] gameobject, from the Steam VR samples).
What I have done so far is that I've attached Empty Game Object to the Camera (in [CameraRig]) and added SteamVR_Behavior_pose (necessaryfor the LaserPointer script; I also changed the Input Source to Head, otherwise the head tracking would stop moving), the SteamVR_LaserPointer and the LaserPointerWrapper from the link above.
Here is a screenshot of the empty GameObject with the 3 scripts attached
Now, the SteamVR_LaserPointer includes 3 events, PointerEnter, PointerExit and Pointer Click. The first 2 are working fine, but the click isn't and I don't really know why, nor what to do about it.
Here is the scene hierarchy, just in case it's not clear. The VRCameraUI is just a reticle I'm using for aiming instead of the laser (which is still there, but invisible due to me setting it's thickness to 0).
Anyone got any hints?
Your answer
![](https://koobas.hobune.stream/wayback/20220612211022im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
raycast activation by trigger 0 Answers
Unity Daydream Preview - Raycast/camera alignment 1 Answer
How do I add UI pop up with this script? 0 Answers
Using Zed Camera Mesh Maker VR 0 Answers