Question by
alejandro93 · Aug 28, 2016 at 10:43 PM ·
androidunity 52dcollider2d
unity2d collider problem in android
Hi everyone.
I got a weird problem. I have C# method that checks if all points of A's collider inside in B's collider. The code is like that :
bool IsInside()
{
for (int i = 0; i < this.GetComponent<PolygonCollider2D>().points.Length; i++)
{
Vector3 vertex = this.transform.TransformPoint(this.GetComponent<PolygonCollider2D>().points[i]);
if (!square.GetComponent<PolygonCollider2D>().OverlapPoint(vertex))
{
return false;
}
}
return true;
}
This method works successfully in Editor. I mean when I test game in desktop, no problem. However it doesn't work properly in my Android device. There is offset for successful method in Android device . I mean the player should press button with an offset(delay). Or I don't know because I can't see collider in android device.
Note : A object is scaling up and down sequentally.
If anyone can solve my problem, I will be happiest man today,
Comment