diff --git a/Assets/Scripts/Core/Stage.cs b/Assets/Scripts/Core/Stage.cs index c241887e..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 (float.IsNaN(pos.x) || float.IsNaN(pos.y) || float.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);