This codes works at placing the beam in the centre point between the tool handle and my mouse position to try creating a "beam attack" effect for my game that connects between the mouse and the characters hand. However when changing the CFrame the beam isnt rotated correctly so the beam is placed floating in the air horizontal in relation to the player. Any idea on how to make this work?
local midPoint = (tool.Handle.Position + mousePos)/2 beam.Size = Vector3.new(distance * 2,3,3) beam.Position = Vector3.new(midPoint.X,midPoint.Y,midPoint.Z) beam.CFrame = CFrame.new(beam.Position, tool.Handle.Position)
Edit: I think part of the problem is that the front surface is looking at the tool but the front surface is the round part of the cylinder is there a way to get around this