This door is supposed to open and close with cframe,
In an empty baseplate it’s animated like butter, but in the game its super choppy
The script looks fine to me. Especially since it works in other places just fine, What could cause lag to Cframe?
for i = 3,(Door.Size.z / 0.15) do
Door.CFrame = Door.CFrame + (Door.CFrame.lookVector * 0.15)
wait()
end
end)
spawn(function()
for i = 3,(Door2.Size.z / 0.15) do
Door2.CFrame = Door2.CFrame + (Door2.CFrame.lookVector * 0.15)
wait()
end
end)```
Are you doing this with a local or server script?
I’m not sure, but would lag be explained by if it’s local the client creates the CFrame, it gets sent to the server, then back to the clients instead of just being created on the server and sent to all clients?
If you CFrame it and want it really smooth why not Tween it? You can calculate the start point CFrame and the end point and have it tween (without the loop) over whatever time frame you choose.