#Why isnt that working ( rotating the cube )

37 messages · Page 1 of 1 (latest)

tawdry lava
#

cframe only works with radians

#
local RunService = game:GetService("RunService")

local cube = script.Parent

local degreesPerSecond = 30
local radiansPerSecond = math.rad(degreesPerSecond)

local function onRenderStep(deltaTime)
    local deltaRotation = deltaTime * radiansPerSecond
    local currentCFrame = cube.CFrame
    local rotationCFrame = CFrame.Angles(0, deltaRotation, 0)
    cube.CFrame = currentCFrame * rotationCFrame
end

RunService.RenderStepped:Connect(onRenderStep)
#

@void zinc

void zinc
#

thx

#

lets see

#

emm that keeps crashing my roblox studio

#

@tawdry lava

tawdry lava
#

i forgot to put task.wait mb

#

but its using renderstep so it probably shouldn't crash

#

local RunService = game:GetService("RunService")

local cube = script.Parent

local degreesPerSecond = 30
local radiansPerSecond = math.rad(degreesPerSecond)

local function onRenderStep(deltaTime)
local deltaRotation = deltaTime * radiansPerSecond
local currentCFrame = cube.CFrame
local rotationCFrame = CFrame.Angles(0, deltaRotation, 0)
cube.CFrame = currentCFrame * rotationCFrame
task.wait()
end

RunService.RenderStepped:Connect(onRenderStep)

#

if it keeps crashing just increase the wait time

void zinc
#

okay

#

it even crashes on 1 second

little jolt
#

add this script to a part and change it's run context to client. it should work without any issues

void zinc
little jolt
#

even if you were on a low end pc it can't lag

void zinc
#

I changed from script to localscript still the same lag

#

oh the lag is like for 15 seconds but its not spinning

#

I can add you to my project or something

little jolt
#

anchor a part and parent the script to the part

torpid scaffoldBOT
#

studio** You are now Level 9! **studio

void zinc
#

to show u

little jolt
#

it's not this script causing the lag

#

i cant rn

void zinc
#

oh I found what was making the lag

#

but still not spinning

#
local main = script.Parent.main
local powloka = script.Parent.powloka
local pociete = script.Parent.pociete
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(3, Enum.EasingStyle.Sine)
local list = {main, powloka, pociete}
local size = {7, 8, 9}
local active = false

function activate()
    for number, object in pairs(list) do
        local big = ts:Create(object, ti, {
            Size = Vector3.new(size[number], size[number], size[number])
        })
        
        big:Play()
    end
    
    active = true
    while active == true do
        
    end
end

wait(5)
activate()``` That was making the lag
#

bruh now I see the infinite loop

little jolt
void zinc
#

let me record you this

void zinc
#

I'm using roblox studio for 3 years but when I joined today that discord I see im dumb