Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CFrame in a tool goes too slow, How do I speed it up??

Asked by 7 years ago

So I'm making a bolt thats on a gun in a tool go backwards. (Like a bolt that gets pulled back.(Basically cocking the gun.)) But the problem is, is that it goes WAY to slow. As you see in the script, I tried making the waits as little as possible but it still goes at the same speed as 0.01... Could someone help me figure out how to speed up the CFrame? Thanks! (NOTE: I am not very experienced with CFrame at all. This line of code is basically the only thing I understand about CFrame.)

Here's the script:

local Bolt = script.Parent

    for i = 1,35 do
    wait(0.00000000000000001)
    Bolt.CFrame = Bolt.CFrame * CFrame.new(0,-0.015,0)
    end
wait(1)
    for i = 1,35 do
    wait(0.00000000000000001)
    Bolt.CFrame = Bolt.CFrame * CFrame.new(0,0.015,0)
    end

1 answer

Log in to vote
0
Answered by
ekweji 4
7 years ago
Edited 7 years ago

Instead of using wait(0.00000000000000001) you can just do wait() for example: for i = 1,35 do wait() Bolt.CFrame = Bolt.CFrame * CFrame.new(0,0.015,0) end

Ad

Answer this question