playMaker

Author Topic: Camera Raycast - read interactable objects visible by VR camera.  (Read 1837 times)

mhlongley88

  • Playmaker Newbie
  • *
  • Posts: 1
Camera Raycast - read interactable objects visible by VR camera.
« on: September 06, 2016, 03:22:04 PM »
Hey all,

Doing some VR with playmaker.

I'm looking for a good approach in playmaker to read what objects are visible to the player - and basically fire off a bool if that object is within the VR camera's raycast.

If an object is within the raycast - mark correlating bool for object in sight to true - and if on mouseButtonUp (Gear VR touch pad), to then tween animate,etc.

I have experience using camera raycasts in C# for VR, so I understand how it works.

I have been having issues getting camera raycasts to work properly in playmaker.

Anyone know a good stand by for camera raycasts in playmaker?
 

PET

  • Full Member
  • ***
  • Posts: 139
    • GamerPET
Re: Camera Raycast - read interactable objects visible by VR camera.
« Reply #1 on: October 25, 2016, 10:51:17 PM »
Anyone else ?

I have some similar problems. I have a normal camera. In the EDITOR everything works. In GearVR it somehow works but it's hard to actualy trigger stuff... (didnt' tested it exactly myself)... but what I tested was an Oculus build where is almost impossible to actually raycast the triggers.

So anyone have any idea how to use a Raycast in VR?

This might be useful:
https://forum.unity3d.com/threads/physics-raycaster-does-not-work-when-vr-is-enabled.393564/

Quote
We've made some changes internally to the Camera viewport rects to fix viewport issues in VR. With this change, the Screen.width and height no longer represent the resolution of the HMD. Screen represents the game view and the HMD resolution is now represented by VRSettings.eyeTextureWidth and VRSettings.eyeTextureHeight. So if you raycast using the Game View's width and height, the ray will be incorrect for VR cameras unless your Game view resolution is the same as the HMD.

You just need to update the GazeInputModule script to use the HMD resolution rather than the Screen resolution.
Technical Game Designer
www.GamerPET.com