Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can you increase the speed of a cframe?

Hello, I am trying to learn a bit of CFraming for a script. I am trying to make a rotating light using rotation and I'm currently using the following script.

sphere = script.Parent 

  

a = 0

off = 0

  

repeat

sphere.Rotation = Vector3.new( 0, a, 0) 

wait(.01) 

a = a+3 

until off == 1 

Does anybody know how this could occur faster as it currently is too slow.

This is what the script does however I was wondering if anyone could tell me how the speed could be adjusted. https://gyazo.com/879f6f3b63919ed5ad123b4b63ded4c3

1 comment

0

make the wait() time smaller or do a = a+6 maybe

2 answers

✓ Accepted answer

Use CFrame.Angles():

repeat
	sphere.CFrame = sphere.CFrame * CFrame.Angles(0, math.rad(a), 0)
	wait() -- The minimum waiting time
	a = a + 3
until off == 1

According to your code, it goes on forever because off is never equal to 1. If this is the case, you can just use a while true do loop.

Increase the value after a = a+3 so its something like: a = a+6

Simply increase the 3 to a higher number for a faster speed

This discussion is preserved as it was. New answers, comments, and votes are closed.