-
What do you want to achieve? Keep it simple and clear!
I want to make a script that turns BaseParts into conveyor belts, free of any work. -
What is the issue? Include screenshots / videos if possible!
It isn’t universal. The attachments I am using are not relative to orientation, and I need them to calculate their own Positions using LookVector. I do believe I should be using LookVector, but I’m not sure. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I actually searched for options for so long I gave up on the idea for a couple of months, until now. I searched the Devforums, Tutorials in CFrame, and scripthelpers.org
local Att1 = Instance.new("Attachment",script.Parent)
Att1.Name = 'Att1'
Att1.Position = Vector3.new(-script.Parent.Size.X/2,script.Parent.Size.Y/2,0)
Att1.Visible = true -- For debug purposes
local Att2 = Instance.new("Attachment",script.Parent)
Att2.Name = 'Att2'
Att2.Position = Vector3.new(script.Parent.Size.X/2,script.Parent.Size.Y/2,0)
Att2.Visible = true -- For debug purposes
local CS = 100
local function setVelocity()
local direction = Att1.WorldPosition - Att2.WorldPosition
local conveyorVelocity = direction.Unit * CS
script.Parent.AssemblyLinearVelocity = conveyorVelocity
end
script.Parent:GetPropertyChangedSignal("Orientation"):Connect(setVelocity)
setVelocity()
print('Auto Conveyor Script made by illuminati6767')