I am trying to make this piece of code (below) run faster, but I have found out that the issue is due to the
CFrame.fromMatrix().
My code
w1.Size = Vector3.new(0.1, Height, math.abs(ab:Dot(Back)))
w1.CFrame = CFrame.fromMatrix((a + b) / 2, Right, Up, Back)
w2.Size = Vector3.new(0.1, Height, math.abs(ac:Dot(Back)))
w2.CFrame = CFrame.fromMatrix((a + c) / 2, -Right, Up, -Back)
This is what this turns into with a little bit more code:
However, if I change my code to this, it runs way better. Even if I use CFrame.new() (it doesn’t change the orientation properly, so I cant use it):
w1.Size = Vector3.new(0.1, Height, math.abs(ab:Dot(Back)))
--w1.CFrame = CFrame.fromMatrix((a + b) / 2, Right, Up, Back) --Both commented out(inactive)
w2.Size = Vector3.new(0.1, Height, math.abs(ac:Dot(Back)))
--w2.CFrame = CFrame.fromMatrix((a + c) / 2, -Right, Up, -Back) --Both commented out(inactive)
So what im wondering is how I would, or could, make it use less off my cpu. I have a beefy one aswell!