Turning the line renderer from the Unity script reference.

This is my first post on Unity Community, I’m probably over thinking this problem. Here is my code for the line renderer which is in Update(). It is in C#.

Here is the Unity script reference

if(Input.GetButton(“Fire1”))
{
line = GetComponent();
int i = 0;
Vector3 mousePosition = Input.mousePosition;

while (i < lengthOfLineRenderer)
{
Vector3 pos = new Vector3(i * 0.5F + player.position.x, Mathf.Sin(i + Time.time) + player.position.y, player.position.z);
line.SetPosition(i, pos);
i++;
line.SetColors(c1,c2);
}
}

It’s a 2d game, I have a feeling that I will need to actually rotate it keeping its local positions the same The sin function for its Y position is whats making this hard, if it were a straight line this would be cake for me.

If I could get this thing to rotate towards the mousePosition vector that would be awesome. Any help would be greatly appreciated. Thanks.

Solved, found it better to use a particle emitter as a cannon.

If anyone can give me direction on how to Delete this thread, or at least mark it as solved that would be great. This thread is going to waste time for people looking for answers. I have been trying to change my title and delete it. Do we not have these controls on threads that we made? If so… Ugh, If not, please send me guidance as this thread seems like a waste of space at this point.