#Spin adjustment

1 messages · Page 1 of 1 (latest)

fleet cliff
#

Hello! If anyone knows, how would I adjust the spin speed of a part to this code, (Im new to this stuff)
while true do
script.Parent:SetPrimaryPartCFrame(script.Parent.Center.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0))
wait()
end

main pebble
#

so if you wanted it to spin every 1 second it'd be this

 script.Parent:SetPrimaryPartCFrame(script.Parent.Center.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0))
 wait(1)
end
fleet cliff
#

Thanks, how would i make it spin fast?

main pebble
#

putting a wait() without its only parameter (the number to wait for) makes it wait a really slow amount

main pebble
#

wait(0.1) or whatever number you want

cinder sonnet
# fleet cliff Hello! If anyone knows, how would I adjust the spin speed of a part to this code...

So as you're new I'll skip the other parts about loops without break conditions and such,

I won't however skip the fact that you're using wait instead of task.wait, task.wait runs 60/s (instead of 30/s) so it's more accurate, and it's also more performance friendly. Wait is only left in luau for backwards comparability.

Also, you can type

while wait() do
end
--or
while task.wait() do
end

--instead of
while true do
  wait()
end
--or
while true do
  task.wait()
end

Anyways, to increase rotation either decrease delay or increase how much it rotates between itts

woeful wigeon
#

wait() is the fastest already

#

try task.wait() as it doesnt constantly check

#

making tthe process a bit faster

#

and less clunky