Like the title says, transform.transformpoint isn't returning the correct value. For some values of the variable point, it's off by a little, some it's off by a lot.
foreach (PolygonCollider2D col in colliders)
{
foreach (Vector2 point in col.points)
{
Vector2 worldPoint = col.transform.TransformPoint(point);
allCorners[index] = worldPoint;
index++;
}
}
Don't worry about the other variables and such, the variable worldPoint returns incorrectly.
↧