So I have a script that creates a beam between two players and right now it’s vertical

but I want it to be horizontal like this

I also want it to rotate the attachment based on the players position relative to the other player (I have already done this). I have tried multiplying the attachments CFrame by using CFrame Angles but that causes all the attachments positions, orientations etc. to be set to Nan. I have also tried setting the orientation manually but that doesn’t seem to be working. Here is what I have currently
local attachment1 = player.Character.UpperTorso.BodyFrontAttachment:Clone()
attachment1.Name = "BeamAttachment"
attachment1.Parent = player.Character.UpperTorso
--attachment1.Orientation = Vector3.new(0,0,90)
local attachment2 = closestPlayer.Character.UpperTorso.BodyFrontAttachment:Clone()
attachment2.Name = "BeamAttachment"
attachment2.Parent = closestPlayer.Character.UpperTorso
--attachment2.Orientation = Vector3.new(0,0,-90)
spawn(function()
while attachment1 do
attachment1.CFrame = CFrame.new(player.Character.UpperTorso.BodyFrontAttachment.Position, closestPlayer.Character.UpperTorso.BodyFrontAttachment.Position)
attachment2.CFrame = CFrame.new(closestPlayer.Character.UpperTorso.BodyFrontAttachment.Position, player.Character.UpperTorso.BodyFrontAttachment.Position)
attachment1.WorldOrientation = Vector3.new(attachment1.WorldOrientation.X, attachment1.WorldOrientation.Y, attachment1.WorldOrientation.Z + 90)
attachment2.WorldOrientation = Vector3.new(attachment1.WorldOrientation.X, attachment1.WorldOrientation.Y, attachment1.WorldOrientation.Z - 90)
wait()
end
end)
local beam = Instance.new("Beam")
beam.Attachment0 = attachment1
beam.Attachment1 = attachment2
beam.Width0 = 2
beam.Width1 = 2
beam.Parent = player.Character
I have tried using normal orientation and world orientation but none of them seem to actually do anything. Any help is much appreciated