📜  roblox 如何让车轮旋转 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:00.137000             🧑  作者: Mango

代码示例1
local r = 2
local v = math.random(20, 50)
local con

con = game:GetService("RunService").RenderStepped:Connect(function(dt)
    wheel:SetPrimaryPartCFrame(wheel:GetPrimaryPartCFrame() * CFrame.Angles(0, dt * v, 0)) -- if your wheel is a model
    v = math.max(v - (dt * r), 0)

    if v == 0 then
        con:Disconnect()
    end
end)