I’ve got a script
local part = script.Parent
local speedX = 60
local speedY = 90
local speedZ = 45
local RunService = game:GetService("RunService")
RunService.Heartbeat:Connect(function(dt)
local rotationDelta = CFrame.Angles(
math.rad(speedX * dt),
math.rad(speedY * dt),
math.rad(speedZ * dt)
)
part.CFrame = part.Parent.Core.CFrame * rotationDelta
end)
And I’m facing a problem where the part is lagging behind the tool
is there anyway to prevent this, ive seen using renderstepped but that is only on the client
You could try welding it, and just updating the rotation of the object in a RenderStepped loop.
That called network delay.
And i am so glad studio simulates it so people are not making this nonsense.
If its a visual effect you should ALWAYS be doing that on a client.
local part = script.Parent
local core = part.Parent:FindFirstChild("Core")
if not core then
warn("Core not found")
return
end
local speedX = 60
local speedY = 90
local speedZ = 45
local RunService = game:GetService("RunService")
local rotation = CFrame.new()
RunService.RenderStepped:Connect(function(dt)
local rotationDelta = CFrame.Angles(
math.rad(speedX * dt),
math.rad(speedY * dt),
math.rad(speedZ * dt)
)
rotation = rotation * rotationDelta
part.CFrame = core.CFrame * rotation
end)
I have made my script but it rotates for 5 seconds then it just completely disappears