Hi there, I'm currently working on a game that requires a UI element for a dialogue piece. I'm using pixel crushers dialogue system and nearly have it working but in between responses the reticle of the laser detaches from the laser itself and gets stuck on the UI. I've replaced the raycasters in the standard prefabs to gvrpointergraphics raycasters and this works apart from the said issue. Does anyone have any idea why this may be? Thanks, Duncan
Hello! I've never used Pixel Crushers Dialogue system, do you still see this same issue when using Unity's UI elements on their own? Can you upload a video or photo of the issue to help me understand what is going on? Thanks, Dan
Hey @dsternfeld ! Thanks for getting back to me, Here is a quick video showing the issue. The change I have made to the canvas of the dialogue manager is to replace the standard graphics raycaster with e the GVRpointerGraphicraycaster. Hope this helps and thank you for all you help! Duncan
Ps I have seen this issue before with unity's standard UI, I resolved it by replacing the standard raycaster with the gvr one but this didn't work here. I'm a bit stumped so any help is very much appreciated! Duncan
Thanks Duncan! Is it possible that there is a standard raycaster that is getting added dynamically while that transition occurs? You could type "t:GraphicRaycaster" in the search bar of the Hierarchy window and see if anything appears during the transition. Also, can you add the following debug code to line 219 of GvrPointerInputModule? Code (csharp): if (raycastResult.gameObject != null) { Debug.Log("Hit Object: " + raycastResult.gameObject.ToString() + ", Raycaster: " + raycastResult.module.GetType()); } else { Debug.Log("Hit Nothing."); } I'd like to see what it output during the time where this behavior is occurring. Thanks, Dan
Thanks Dan, Unfortunately there doesnt appear to be another instance of a graphicraycaster being created during the transition. The search doesnt throw up anything. Adding the code you suggest below shows the following outputs when hitting nothing, then it appears to be hitting a background object then the label. I've tried disabling raycast target for these objects with no joy: Code (CSharp): Hit Nothing. UnityEngine.Debug:Log(Object) GvrPointerInputModule:CastRay() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:225) GvrPointerInputModule:process() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:144) UnityEngine.EventSystems.EventSystem:Update() Hit Object: Background (UnityEngine.GameObject), Raycaster: GvrPointerGraphicRaycaster UnityEngine.Debug:Log(Object) GvrPointerInputModule:CastRay() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:221) GvrPointerInputModule:process() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:144) UnityEngine.EventSystems.EventSystem:Update() Hit Object: Label (UnityEngine.GameObject), Raycaster: GvrPointerGraphicRaycaster UnityEngine.Debug:Log(Object) GvrPointerInputModule:CastRay() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:221) GvrPointerInputModule:process() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:144) UnityEngine.EventSystems.EventSystem:Update() I've created a small unitypackage to show the issue. Sorry for the hassle and thanks for your help so far @dsternfeld Duncan
Hi sorry, one more point on this. I've found that this isn't actually related to the dialogue system asset (which is V good by the way). I created a simple scene with a canvas and a button and added three event triggers, for onpointerenter, exit and click. The onenter and onexit triggers worked fine, they changed the colour of the button, however when clicking I called a function to destroy the button and then the issue arises. The reticle becomes detached from the laser and locks in place, however looking in the scene view there still seems to be some rotation related to the orientation of the controller, it just doesn't move in relation to the laser. Hope that helps! I must be doing something very wrong! Thanks! Duncan
Thanks for the additional info Duncan, it was very helpful! I believe I understand what is causing this now. The issue is caused by a bug in GvrPointerInputModule that occurs when a GameObject is destroyed while it is being pointed at. It has already been fixed for the next release of the Unity GVR SDK. Below is the modification that must be made to GvrPointerInputModule to fix it in the meantime. Replace lines 273-285 of GvrPointerInputModule with the following code: Code (csharp): if (isPointerHovering && currentObject != null && currentObject == previousObject) { pointer.OnPointerHover(currentObject, intersectionPosition, GetLastRay(), isInteractive); } else { // If the object's don't match or the hovering object has been destroyed // then the pointer has exited. if (previousObject != null || (currentObject == null && isPointerHovering)) { pointer.OnPointerExit(previousObject); isPointerHovering = false; } if (currentObject != null) { pointer.OnPointerEnter(currentObject, intersectionPosition, GetLastRay(), isInteractive); isPointerHovering = true; } } Add the following member variable to the GvrPointerInputModule class: Code (csharp): private bool isPointerHovering = false; Thanks, Dan
Dan! You are such a legend, that's worked perfectly! Thank you so so much, I massively appreciate it. Duncan
It looks like this has been fixed in Google VR Unity SDK version 1.3, GVRPointerInputModule.cs, lines [64], [296-310]
I reproduced the issue in Unity 5.6.0f3 even though the GVR SDK has those updates in the GVRPointerInputModule.cs file.
Hey Tepo01! Can you please provide a simple sample project that reproduces the issue with the latest SDK in Unity 5.6.0f3? Thanks, Dan
Managed to reproduce this issue on Unity 2017 V3. Resolved by scaling down the size of the target sphere. I found the Target Sphere was colliding with the camera when the player moved from point to point.