I am making a factory tycoon but when I make the parts spawn onto the conveyor belt they are glitchy and sometimes just stop moving but I can go on it completely fine. What’s going on?
(The conveyor belt moves on the client side btw but its to reduce lag because I would have 10 of them running at once)
How are you moving the conveyor?
Is it an Anchored Part with a BodyVelocity in it?
Are the arrows a Beam?
It looks like the blocks are getting stopped before the entrance. You could use Collision Filtering to allow only the blocks to get inside the counter.
Here is the code for the conveyor:
local TweenService = game:GetService("TweenService")
local CollectionService = game:GetService("CollectionService")
local Info = TweenInfo.new(60, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
for _, conveyor in pairs(CollectionService:GetTagged("conveyor")) do
local Speed = conveyor:GetAttribute("Speed")
conveyor.AssemblyLinearVelocity = conveyor.CFrame.LookVector * Speed
conveyor:GetAttributeChangedSignal("Speed"):Connect(function()
conveyor.AssemblyLinearVelocity = conveyor.CFrame.LookVector * conveyor:GetAttribute("Speed")
end)
local Texture = conveyor.Texture
local Tween = TweenService:Create(Texture, Info, {OffsetStudsV=-300})
Tween:Play()
end
Why Tween the Texture? Just use a Beam.
What happens if you disable the script then just go into the conveyor Part Properties and change the AssemblyLinearVelocity manually, like this: Making a Conveyor
If it doesn’t need to be scripted they why do it?
That worked perfectly. The script was for if I duplicate it and did not want to set it up manually but how do you use a beam for the textures?
You can set up two attachments (name doesn’t matter but for simplicity you can just do Attachment0 and Attachment1) and insert a beam into the part. In beam properties you can select the two attachments and move the attachments to opposite ends of the conveyor belt. (If your beam is facing vertically instead of horizontally you can rotate both attachments)
Make sure to insert the texture ID in properties and make any adjustments necessary
How do I make the conveyor belt only move on the client side. With your method.
You can’t.
Why move it only client side? Have you seen any tycoons that move the Parts only on each player’s client?
If you want the Parts to not appear for others just make them client sided, that way the other players won’t see them, but they’ll still appear on the client. Then the conveyor can run all the time since it’s not scripted and won’t cause any lag issue in game.
Ok thank you I was concerned about it causing lag.