Conveyor only goes one way?

The conveyer script I have for my game is meant to set the velocity to the lookVector * speed, but it doesn’t matter what angle it’s on, what the speed is set to, the velocity is always set to (0, 0, 20)

Script -

local conveyor = script.Parent
local velocity = conveyor.AssemblyLinearVelocity
local speed = 1
local lookVector = conveyor.CFrame.LookVector

conveyor.Changed:Connect(function()
	velocity = lookVector * speed
end)

It looks like you forgot to update the lookVector.

conveyor.Changed:Connect(function()
    local lookVector = conveyor.CFrame.LookVector

	velocity = lookVector * speed
end)
1 Like

I just tried that, the velocity doesn’t change :confused:

Oh wait, I found another mistake. You have to set the velocity directly.

conveyor.Changed:Connect(function()
    local lookVector = conveyor.CFrame.LookVector

	conveyor.AssemblyVelocity = lookVector * speed
end)
2 Likes

It’s fixed, I also realised that the change only happens after it’s rotated, but that should be easy to fix too (cause it’s moved in from rp)

Thanks for your help :smiley: