I am trying to make a tank track using beams. Ive almost got my desired outcome exept for one thing. The beam rotates opposite of the desired direction. Here is a video showcasing the problem:
Here is the section of code responsible for alligning the attachments:
if v:IsA("Attachment") then
if v.Name == "BeamAtt" then
v.WorldCFrame = v.Parent.CFrame - Vector3.new(0,1.7,0)
v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
elseif v.Name == "BeamAtt1" then
v.WorldCFrame = v.Parent.CFrame + Vector3.new(0,2.1,0)
v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
elseif v.Name == "BeamAtt2" then
v.WorldCFrame = v.Parent.CFrame + Vector3.new(0,1.3,0)
v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
elseif v.Name == "BeamAtt3" then -- The beam rotating the opposite direction
v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
v.WorldPosition = Vector3.new(v.Parent.Position.X, v.Parent.Position.Y,v.Parent.Position.Z-1.8)
elseif v.Name == "BeamAtt4" then
v.WorldCFrame = v.Parent.CFrame + Vector3.new(0,0,1.8)
v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
--v.WorldOrientation = Vector3.new(0,-Seat.Parent.PrimaryPart.Orientation.Y,-90)
end
end
Any help would be greatly appreciated.