✓ Accepted answer
Loops cause a lot of lag if you don't add a wait(). The thing is, wait() can cause lag standalone if you don't add a number, like wait(.1). You can add a wait() but you can also do an event.
script.Parent.MouseVectorP:GetPropertyChangedSignal("Value"):Connect(function()
frame.CFrame = CFrame.new(frame.Position, script.Parent.MouseVectorP.Value)
wait(.01)
end)
Above we have an event that fires every time the value of MouseVectorP changes, and once it fires we orientate the frame accordingly.
3 comments
Also, I used a while loop to update it.
You need way more code than just that one line
Don't use a while loop to update it, instead use RunService events