Hi,
I’ve been working on a basic laser sight (using a line renderer) for my 2.5D style side shooter.
Using the code below I’ve calculated the end point of the sight based upon the mouse location (and limited it so the player can’t do a full flip) and it works.
GetComponent<LineRenderer>().SetPosition(0, new Vector3(transform.position.x, transform.position.y, transform.position.z));
Vector3 mousePosition = camera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y, Input.mousePosition.z - camera.transform.position.z));
if (mousePosition.x <transform.position.x+10) mousePosition.x = transform.position.x+10;
Vector3 pointTo = new Vector3(mousePosition.x,mousePosition.y, transform.position.z);
GetComponent<LineRenderer>().SetPosition(1, pointTo);
However, Instead of the end point ending where the players mouse is, I want the line to continue off the screen. I’ve used the scale method but the result is undesired. The line is a long way offset from where the bullet is going.
Code to scale:
pointTo.Scale(new Vector3(2f,2f,1f));
(I wanted to keep the z on it’s current position)

how did you try this? did you account for the fact the line isn’t starting at the origin?
I’ve edited the post to show my code useage of the scale function.
No I didn’t…how would I do that?
Can’t you just multiply the vector?
pointTo *= 2f;
Just multiplying pointTo will, as has been hinted, just move it further away from the origin (0,0,0), NOT further away from the player. You will need to subtract the player’s position (giving you an “offset” vector, that is, the direction the line is moving). THEN you can multiply it by whatever. After the multiplication, add the player’s position back into it.
I get the feeling this probably isn’t what you really want though. This will always cause the laser to be double the distance that was specified, but what it sound like you really want is a laser that’s a set length (of a little more than the maximum distance on screen). That method may require some trig to get the angle though.
StarManta has a point in that you need to make sure to keep things relative.
If you want a fixed length, then you’ll want to do the same thing I suggested, except you use theOffsetVector.normalized, and then multiply that by your desired length.
GetComponent<LineRenderer>().SetPosition(1, transform.position + (PointTo - transform.position).normalized * distance);
Thanks for all of your suggestions. I now understand how to get it working 
This code worked perfectly - thanks!
Glad it worked. You should consider splitting complex lines like that up into several lines, though - if you have a problem in the future, separate lines will make it 10x easier to pinpoint to cause of the error.