Hello all,

This may seem like a repeated question, but I have tried all the code possible to achieve what I’m trying. I have a fishing rod and a hook at the end of the rod. Where ever I click on the screen, based on the y index of the click I move my hook to that position. So say for instance my hook is currently at (2,3) if I click at (400, 9) I move my hook to (2,9). So i just move it vertically based on the click.

This is working fine. Now based on the position of the hook I want to scale my fishing rod accordingly. So once im done positioning my hook I call the following ScaleRod(). The rod sprite has a pivot at top-left, and not center. I want to rod to scale only vertically. Below is my code for the same:

```
void scaleRod() {
//get current size of the fishing rod
var rodLength = System.Math.Abs(renderer.bounds.size.y);
//Get distance between the hook and the rod based on y coordinates.
float hookRodDistance = (System.Math.Abs(transform.position.y) + rodLength) - System.Math.Abs(hookObject.transform.position.y);
hookRodDistance = System.Math.Abs(hookRodDistance);
//Calculate the scale factor
float scaleFactor = hookRodDistance / rodLength;
//Scale the rod
transform.localScale = new Vector3(transform.localScale.x, scaleFactor * transform.localScale.y, transform.localScale.z );
}
```

The function is giving me wierd output on the scale.

Can someone please help. Have been stuck for a while on this.

Thank you so much.