How would I make this part rotate and stay in front of the part rotating?

I am trying to make a cash spawner in a bank and it will rotate so it doesnt bunch up in one area, the cash spawns perfectly fine, but the only issue is where its supposed to spawn doesn’t rotate nor stays in front of the other part that is rotating.

Image before ran:


Gif while running: https://gyazo.com/6a1df33561528f753f66cdc99a94f8a1

The two parts are welded to eachother, yet nothing happens, here is my rotate script:

while true do
	for i=0,360,1 do
		script.Parent.Orientation = Vector3.new(0,i,0)
		wait(.001)
	end
end

How would I make it so the spawner part stays in front of the rotator?

Try making it a model, and then using the part you are rotating as the primary part. you can then rotate it and then use this script in the model:

local model = script.Parent
while true do
    for i = 0, 360, 1 do
        local newCFrame = model.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(i),0)
        model:SetPrimaryPartCFrame(newCFrame)
        wait(0.001)
    end
end

this should rotate the entire model.

1 Like

Or you could do this for even more simplicity:

local model = script.Parent
local degrees = 1

while true do
    local newCFrame = model.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(degrees),0)
    model:SetPrimaryPartCFrame(newCFrame)
    wait(0.001)
end
1 Like

U could just weld the spawner to the rotator

Using any number less than 0.03 as an argument for wait is pointless, it can’t go below the default value.

That is what I did. But I found a solution already.

Your right, I guess that is true :sweat_smile: