How to make a circular conveyor belt in roblox

I want to make a circular conveyor belt. I have a flat cylindrical object that spins, and I want the player to follow the rotational direction when the object spins.

Here is my code rn, but this code does not work properly because the conveyor aspect doesn’t work
– Variables
local part = script.Parent – The part to spin
local isSpinning = true – Toggle to control spinning
local spinSpeed = 100 – Degrees per second
local ConveyerSpeed = 14
– Function to start spinning
local function spinPart()
while true do
if isSpinning then
– Rotate the part continuously
part.CFrame = part.CFrame * CFrame.Angles(math.rad(spinSpeed * task.wait()), 0, 0)
part.Velocity = part.CFrame.lookVector *ConveyerSpeed
else
break
end
end

end

spinPart()

2 Likes