Conveyors orientation being off?

Ive made a marble run tycoon thing and I made a conveyor belt to move the marbles up but the problem is that based on where your tycoon location is the orientation of the platform can be reversed…
what I’m looking for is no matter where your tycoon spawns, the conveyors platforms should be the correct way around.

here are a few screen shots explaining it
how it should look like


How it shouldn’t look like.


What it looks like from above

I know I could just make the tycoon just all lined up in 1 line but that looks super boring and I’d have to redo the background again

here is the script

local TweenService = game:GetService("TweenService")
local platform = game.ServerStorage.Platforms.Platform
local target = script.Parent.Target -- where the platforms end

local tweenInfo = TweenInfo.new(
	5,-- time
	Enum.EasingStyle.Linear, -- easing style
	Enum.EasingDirection.In, -- easing direction
	1, -- repeat count
	false, -- reverses
	0 -- delay time
	
)
	
function SpawnTween()
	local newPlatform = platform:Clone()
	newPlatform.Parent = script.Parent.Platforms -- folder for where the peices go
	newPlatform.CFrame = script.Parent.CFrame -- sets the platforms location to the platform spawners location
	newPlatform.Orientation = Vector3.new(-25, 0, 0) -- makes the platform a bit tilled to let the marbles roll off at the end
	
	local tween = TweenService:Create(newPlatform, tweenInfo, {Position = target.Position})
	
	tween:Play()
	
	wait(5)
	
	newPlatform:Destroy()
end

while true do 
	spawn(function()
		SpawnTween()
	end)
	wait(2)
end

thanks :heart:

  • Brant

You are setting the orientation of newPlatform in world space. If the orientation of platformSpawner correctly depends on tycoon location, then setting the orientation of newPlatform relative to its initial orientation (which is the same as platformSpawner.Orientation because the CFrame is set to be equal to platformSpawner.CFrame) should fix the problem.

Try replacing

newPlatform.Orientation = Vector3.new(-25, 0, 0)

with

newPlatform.CFrame *= CFrame.fromOrientation(math.rad(-25), 0, 0)