Conveyor Belt Only Moves Parts Only One Direction

So, I’m trying to make conveyor that moves parts. And here’s the conveyor:RptPict
(This conveyor is grouped.)

But issue is this conveyor moves parts in only one direction.
I tried detecting orientation to set velocity of conveyor, but is is not working, it only pushes in one direction.

Original Script That I Wrote:

while wait() do
	script.Parent.Velocity = script.Parent.CFrame.LookVector * 10

The Script That Detects Direction:

local directions = {0,180,-90,90}

function calculate(pow)
	local rot = script.Parent.Orientation.Y
	if rot == directions[1] then
		return script.Parent.CFrame.LookVector * pow
	elseif rot == directions[2] then
		return -script.Parent.CFrame.LookVector * pow
	elseif rot == directions[3] then
		return -script.Parent.CFrame.RightVector * pow
	elseif rot == directions[4] then
		return script.Parent.CFrame.RightVector * pow

while wait() do
	script.Parent.Velocity = calculate(5)

A quick note: I tried to removing main conveyor from group and rotated it. But velocity on conveyor keeps setting to 0,0,0.


The original script doesn’t need to be in a while loop, if it is then it will overwrite anything you try to change

What are you even talking about? The post is here, and you did not even respond to the question

I did I said that he needs to remove the while loop in the original script

But Removing while loop doesnt helped me, I want to set conveyor’s velocity value according to direction.

But you have a while loop setting the velocity in the original script, if you change it from the other script then the while loop will set it back to what it was

Ok, I wrote a script that places conveyors. But, when I place a conveyor, conveyor doesn’t pushes parts.

Here is the video:
robloxapp-20200604-1114595.wmv (3.2 MB)

As you can see, I removed conveyor part (In red circle) from conveyor model and Tried to clone in game using my placing script, but It’s velocity properties is (0,0,0). Even the enabling script after delay didn’t work.

Have you checked that the velocity isn’t constantly being replaced by the one you wrote first here is what @Barty200 is trying to say.

1 Like

Yes, I removed while loop from script but still problem happens.

Are you absolutely sure that your orientation Y value changes when you rotate it correctly as well as that it’s not stuck at the same number even when rotated?

For example, if you rotate the conveyor, the orientation Y value should change correctly by only the direction values you have in the table and it should change for it to work.

I solved this problem, I need to do is removing velocity script and writing this code in the conveyor placing script (It places random direction because testing) :

	local a = {0,90,180,-90}
local rot = a[math.random(1,4)]

b.Orientation =,rot,0)
b.Velocity = b.CFrame.LookVector * 5

Anyway, thanks for your help!