Hello.
I have a sprite gameobject, which I want to scale by x axis in order to fit it between two points.
I have this script:
public void strechBetween(Vector2 point1, Vector2 point2)
{
Vector3 scale = transform.localScale;
scale.x = Vector3.Distance(point1, point2);
transform.localScale = scale;
}
But it streches to much. Is there any other solutions?