Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I rotate conveyors?

I'm trying to make a game kinda like satisfactory where you build conveyors to transport materials to make stuff. I’m trying to make the conveyors as of now but don’t know how?

What I tried (And failed) to use

I thought that using bones would be a greater start, but I can't figure out how to use them and the documentation isn’t that helpful.

I then thought about using pathfinding to connect two points with lines then convert them to conveyors.

Beams. They don't have collisions

I'm trying to make something like this

(Only conveyors)

I'm not trying to make the conveyors move. I'm trying to make them curve to where they need to be.

What succeeded but sucked

The green is terrain

local pos1 = workspace.A.Position
local pos2 = workspace.B.Position

local path = game:GetService("PathfindingService"):CreatePath()
path:ComputeAsync(pos1, pos2)
local points = path:GetWaypoints()

for i,v in ipairs(points) do
	local a
	local b
	
	if i == 1 then
		continue
	elseif i > 1 then
		a = points[i-1].Position
		b = v.Position
 	end
	
	local part = Instance.new("Part",workspace)
	part.Anchored = true
	
	local MiddlePosition = (a + b) / 2
	local c = (a - b)
	part.Position = MiddlePosition
	part.CFrame = CFrame.lookAt(MiddlePosition,b)
	part.Size = Vector3.new(1, 1,c.Magnitude)
end

1 answer

Alright my friend, there was this nice tutorial i had once done, and it included rotating a block. You can easily achieve what you want with the following code

local part = game.Workspace.part
 

local newCFrame = CFrame.Angles(0, math.rad(45), 0)
 

part.CFrame = newCFrame

1 comment

0

I know how to rotate them. I'm trying to make the conveyors move along a path, like in satisfactory

This discussion is preserved as it was. New answers, comments, and votes are closed.