virtual-reality

OnPointerEnter is not being called

∥☆過路亽.° 提交于 2020-03-03 09:00:22
问题 I'm trying to animate the button while it is being gazed on. I have got the following code in which I Raycast from a sphere to find the button that it hits. var eventDataCurrentPosition = new PointerEventData(EventSystem.current); eventDataCurrentPosition.position = screenPosition; var results = new List<RaycastResult>(); EventSystem.current.RaycastAll(eventDataCurrentPosition, results); foreach (var result in results) { Debug.Log(result.gameObject.name); } In order to animate the button, I'm

OnPointerEnter is not being called

拥有回忆 提交于 2020-03-03 08:59:24
问题 I'm trying to animate the button while it is being gazed on. I have got the following code in which I Raycast from a sphere to find the button that it hits. var eventDataCurrentPosition = new PointerEventData(EventSystem.current); eventDataCurrentPosition.position = screenPosition; var results = new List<RaycastResult>(); EventSystem.current.RaycastAll(eventDataCurrentPosition, results); foreach (var result in results) { Debug.Log(result.gameObject.name); } In order to animate the button, I'm

Unable to shoot an object in Unity game. Error-ArgumentException: The Object you want to instantiate is null

浪尽此生 提交于 2020-03-03 08:01:05
问题 I'm making a Shooting game for VR in Unity and I'm unable to shoot the object. Everytime I point the object, it throws this error. I tried other posts with same error but they does not answer my problem. ERROR- ArgumentException: The Object you want to instantiate is null. UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:239) UnityEngine.Object.Instantiate (UnityEngine.Object

How to prepare my game for VR? [closed]

狂风中的少年 提交于 2020-01-30 13:04:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Let's imagine we have some C++ OpenGL game. It uses our own engine for render (nor Unity, nor UE, etc). Let's simplify our problem. For example, we need to render some simple cube in VR mode. What we should do for that? I know we need to split our screen into two parts. But what

How to prepare my game for VR? [closed]

折月煮酒 提交于 2020-01-30 13:02:28
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Let's imagine we have some C++ OpenGL game. It uses our own engine for render (nor Unity, nor UE, etc). Let's simplify our problem. For example, we need to render some simple cube in VR mode. What we should do for that? I know we need to split our screen into two parts. But what

questions of transform matrix in VR

笑着哭i 提交于 2020-01-24 12:27:07
问题 I have a problem about matrix transformation in OpenVR api. m_compositor->WaitGetPoses(m_rTrackedDevicePose, vr::k_unMaxTrackedDeviceCount, nullptr, 0); in the demo which the openvr gives: const Matrix4 & matDeviceToTracking = m_rmat4DevicePose[ unTrackedDevice ]; Matrix4 matMVP = GetCurrentViewProjectionMatrix( nEye ) * matDeviceToTracking; glUniformMatrix4fv( m_nRenderModelMatrixLocation, 1, GL_FALSE, matMVP.get() ); where GetCurrentViewProjectionMatrix is calculated with Matrix4

Canvas is not rendering on top

こ雲淡風輕ζ 提交于 2020-01-22 14:55:27
问题 I used a canvas and Unity UI elements as a HUD. I want HUD to be in front of everything but it's not. 回答1: Haven't worked with Cardboard before but I beleive you can fix this with camera culling. Just follow the steps below: Canvas : 1.Select the Canvas and change the Layer to UI. The default is UI but make sure that it is still set to UI. Default/Main Camera : 1.Select the Main Camera that was there already there and change the Clear Flags to Skybox . 2.Change the Culling Mask to Everything

Android video decoder not drawing to gles surface on lollipop only

不问归期 提交于 2020-01-15 12:17:11
问题 Briefly, I'm combining two open source apps into a new VR app, so this only runs on the Note 4 and S6 using the GearVR headset. My app works on kitkat, but the video is black on lollipop. The two source apps both work fine on lollipop. I have a surface created from a gl texture: glGenTextures( 1, &textureId ); glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG

How to prevent automatic re-centering when scene is loaded on Gear VR?

混江龙づ霸主 提交于 2020-01-06 15:50:55
问题 I'm using Unity 5 and OVR utilities, I'd like to avoid the scene being recentered every time I load a new scene. Basically, I'd like the player to be able to sit down and even if he's looking at his right at the moment of a new scene loading, I'd like him to be able to continue playing without having to use some manual recentering or having to change his sitting position. I've found 2 other posts with the same question but only for other VR platforms and they didn't solve my problem: Persist

Google Cardboard SDK not working in Unity 5.4.1f (Gvr Controller script not loaded)

时间秒杀一切 提交于 2020-01-05 05:26:15
问题 I'm trying to use Google Cardboard SDK with Unity 5.4.1f (Free). After importing the unitypackage with SDK, I tried to run the demo scene, but I see only freezing camera. I can't look around with mouse, just static picture. And I see the errors in Console and Inspector tab. Here is the screenshot: I tried to import different versions of Cardboard SDK and also tried Unity 5.3, but got the same errors. Please help me, I don't know what's wrong with it. 回答1: The project is likely corrupted. Make