How to make my model spin around

Hi! You’ve probably seen what i’m about to show you.

I’m trying to make it so that it spins around randomly.
Although I don’t know how to script. :flushed:

I would greatly appreciate if you can tell me how to do it!

local pivot = script.Parent:GetPivot()

while true do
script.Parent:PivotTo(pivot * CFrame.new(0,math.rad(math.random(-5,5),0)
task.wait()
end

Probably won’t work but if it does then yay

Where should I put it? In the place I want it to move? And should it be a local script?

It should be a script inside the model

Anchored or unanchored? Sorry for asking a lot

It’s not working. (It’s anchored, unanchored the parts fall.)

Anchored (character limit limit)

Edit: Lemme try testing it on stuff and fixing it brb
Edit 2: Found the error I forgot to add some brackets ill post the new code now
Edit 3: Found a new error but I fixed it and im now posting the code (sorry for saying this a lot)

1 Like

Here you go

local model = script.Parent

while true do
	local randomAngle = math.rad(math.random(-5,5)) -- If you don't want it random instead of math.random(-5,5) do 5
	local pivot = model:GetPivot()
	model:PivotTo(pivot * CFrame.Angles(0,randomAngle,0))
	task.wait()
end

Tell me if it works

MRGS_TOOLBOX.rbxl (29.5 KB)

This is what’s happening:

robloxapp-20210912-1612147.wmv (677.2 KB)

I cant see da video :frowning:
Can u send it in something like Gyazo?

I can’t atm but what’s happening is it’s rotating to the sky not staying on the base.

I think it might be cuz the pivot is kinda turned

Can u select the model and check the Pivot Orientation?

1 Like

@S_xnw already solved it… thank you so much for trying.

1 Like