The unwanted movement is shown in the clip below
External MediaI dont exactly know why that movement happens, but the desired movement is shown below
External Mediacode:
local w_4 = Instance.new("Weld")
w_4.Part0 = be1
w_4.Part1 = beam_1
w_4.Parent = be1
w_4.C0 = w_4.Part0.CFrame:ToObjectSpace(CFrame.lookAt(char:WaitForChild("HumanoidRootPart").Position + Vector3.new(0,0,0), mouse)) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))