I’m trying to make a “Hook” sprite move from its position to a fish with a certain speed using Vector2.Lerp() functio, but the problem is, it seems that the sprite teleports (in high speed), I tried a while loop to add distance, but still teleports.
How can I make it go slowly ? (maybe using “Time” class)
f(Hit.collider !=null && Hit.collider.GetComponent<Rigidbody2D>() !=null){
Hook_Distance = 0f;
joint.enabled = true;
Line_Go.enabled = true;
Line_Go.SetPosition(0, new Vector3(this.transform.position.x, this.transform.position.y, -1));
Line_Go.SetPosition(1, new Vector3(Hook_Sprite.position.x, Hook_Sprite.position.y, -1));
while( Vector2.Distance(Hit.collider.transform.position, Hook_Sprite.position) > Hook_Distance){
Debug.Log(Hook_Distance);
Hook_Distance =+ 0.1f ;
Hook_Sprite.position = Vector2.Lerp(Hook_Sprite.position, Hit.collider.transform.position, Hook_Distance);
}