Spinning part lags when humanoids come near it?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    for the part to spin smoother

  2. What is the issue? Include screenshots / videos if possible!
    part will spin smooth but once humanoids come near/at it, it begins to lag/stutter

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    tried “CFrame.fromEulerAnglesXYZ(0,0.1,0)” and "CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) "

Is there a better tool for having parts spin?

while true do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 00.1, 0) 
	wait()
end

The zombies uses a loop too and its yielding the spinning part while loop? or its due to NetworkOwnership changing?
That spinning loop its server or client sided?
You tried using a RunService step instead of a while loop? or maybe TweenService?

Make the spin client sided and using a tween service.

yeah, but if that spinning thing is relevant to the game, that would be letting exploiters to play with that thing as they wish

Hello Creator,

Perhaps this could help you.

local PartCFrame = workspace.Part

while (true) do
	PartCFrame.CFrame = PartCFrame.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) -- x / y / z
	wait(0.01)
end

Or:

I recommend using an animation that you make yourself, this causes the animation in an AnimationController to run unprocessed by the GPU but by the KeyFrame Server, but if you want to do it by script this is the script, but it will be lagged if there is any reason to get arrested.

its server sided, will try using RunService and will report back if that works. Im still pretty unfamiliar with TweenService’s

Runservice step fixed the issue :grinning:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.