Hey guys!
I’m working on a game and everything runs okay on the editor, but when I build the game on Android and ios platforms, sometimes the screen goes into blue and I receive this error:
Screen position out of view frustum (screen pos 690.000000, 808.000000) (Camera rect 0 0 828 1792)
UnityEngine.Camera:ScreenPointToRay(Vector2, MonoOrStereoscopicEye)
UnityEngine.Camera:ScreenPointToRay(Vector3, MonoOrStereoscopicEye)
UnityEngine.Camera:ScreenPointToRay(Vector3)
UnityEngine.SendMouseEvents:smile:oSendMouseEvents(Int32)
And Sometimes this one:
Screen position out of view frustum (screen pos 675.000000, 167.000137) (Camera rect 0 0 1170 2532)
UnityEngine.RectTransformUtility:pointInRectangle(Vector2, RectTransform, Camera, Vector4)
UnityEngine.UI.GraphicRaycaster:Raycast(Canvas, Camera, Vector2, IList1, List
1)
UnityEngine.UI.GraphicRaycaster:Raycast(PointerEventData, List1) UnityEngine.EventSystems.EventSystem:RaycastAll(PointerEventData, List
1)
UnityEngine.EventSystems.PointerInputModule:GetTouchPointerEventData(Touch, Boolean&, Boolean&)
UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:process()
The error keeps appearing in every frame with different screen positions.I’ve also included an explanation of my project if you want to understand it better:
My project’s scale is too big, and everything is 50 times bigger than a normal object so I’ve been forced to set the far clip to 6000. I’m using Cinemachine virtual cameras that instantiate during playtime. The main camera is in the perspective mode, Doozy UI and Lean touch + are used in the project, as well as Lean joystick from the Lean GUI package. The lights are baked and we have a light probe on the scene. My unity version is 2020.3.21f1. And the project is not Hololens or VR.
I’ve read everything on the internet about this issue and done whatever I could but my problem still remains.
Here is what I’ve done so far:
- Remove the camera’s tag and make it “Untaged”
- Increase camera’s a near clip
- Debug camera rect, camera scale, camera size, FOV, near clip, far clip but none of
them change when the bug occurs - Removed cinemachine from my project
- Make sure that my camera does not instantiate during run time
- Make sure that the main scene added to the build setting
- Remove the main camera and create another one
- Remove light baking and light probe
- Remove every light from the scene
- Downgrade the unity to 2019.4.28f1
I think the problem may be from lean touch, especially the joystick script.
There are some functions like:
RectTransformUtility.WorldToScreenPoint
and RectTransformUtility.ScreenPointToLocalPointInRectangle
that I’m suspicious to them and tried to check the pointer and screen values before calling them but it didn’t help also.
Could anyone help me with this?