diff --git a/Assets/Scripts/Core/Stage.cs b/Assets/Scripts/Core/Stage.cs index 006fd481..0b671c53 100644 --- a/Assets/Scripts/Core/Stage.cs +++ b/Assets/Scripts/Core/Stage.cs @@ -917,7 +917,9 @@ void GetHitTarget() #endif pos.y = Screen.height - pos.y; TouchInfo touch = _touches[0]; - if (pos.x < 0 || pos.y < 0) // outside of the window + if (float.IsNaN(pos.x) || float.IsNaN(pos.y) || float.IsInfinity(pos.x) || float.IsInfinity(pos.y)) //not a valid position + _touchTarget = this; + else if (pos.x < 0 || pos.y < 0) // outside of the window _touchTarget = this; else _touchTarget = HitTest(pos, true); @@ -1810,4 +1812,4 @@ public DisplayObject ClickTest() return obj; } } -} \ No newline at end of file +}