How can i spin a model?

Actually i using this script for parts but how can i make one for models?

local partspeed = 0.05
local part = script.Parent
while task.wait() do
	part.CFrame = part.CFrame * CFrame.Angles(0,partspeed,0) 
end 
1 Like
local model = PATH_TO_MODEL
local spin = 25
while task.wait() do
   model:PivotTo(model:GetPivot() * CFrame.Angles(0, math.rad(spin), 0))
end
4 Likes

Hello @s_schwerer! :happy1:
This is how you spin an object.

local partspeed = 0.05
local model = script.Parent

while true do
    for _, part in pairs(model:GetDescendants()) do
        if part:IsA("BasePart") then
            part.CFrame = part.CFrame * CFrame.Angles(0, partspeed, 0)
        end
    end
    wait()
end

If you found my answer useful, do not forget to mark it as solved :white_check_mark:.
@Katastro5 :cool:

1 Like

You can use model.PrimaryPart

local partspeed = 0.05
local Model = script.Parent
while task.wait() do
	Model.PrimaryPart.CFrame = Model.PrimaryPart.CFrame * CFrame.Angles(0,partspeed,0) 
end
1 Like

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