How can I create a 'vertical treadmill' type movement?

Hello, I have a treadmill model, and I need to use RunService to move the parts in a rectangular motion around the base. I have already tried many things. like using math.cos, and math.sin.

Here are 2 examples:
This is what I would be working with:

,

This is how it should be rotating. The text ‘Base’ is the right side of the Treadmill base; if looking at it from the front direction indicator

Here is the example code block on a single treadmill to make sure the math is correct:

function QuestsManager:StartQuest1()
	print("Starting Quest 1 logic!")

	local basePart = workspace["QUEST 1"].Treadmills.Treadmill45.Base
	local platforms = workspace["QUEST 1"].Treadmills.Treadmill45.TweenParts:GetChildren()

	RunService.Heartbeat:Connect(function(dt)
		-- Math logic goes here --
	end)
end
   

Any help would be greatly appreciated, as I am not very efficient yet at complex math systems like this!

1 Like

This would not be easy to do the way I think you want to. It could be done and would be a lot like tank tracks. There are a few models with tank tracks you could look at but, again… not easy.
I’d be looking for a way to fake this. Maybe a top on the units I see here and boards going up or down by their own means, via tween or other script.

Conveyor Belt super simple flat version.
Conveyor Belt possible alternative.

The way you want it you would need to look into components like motors, constraints. VectorForce/Torque… mechanical parts. Well worth learning.

Assuming that this is some sort of climbing treadmill and those white part platforms move along the treadmill base…

Just addressing the positions,
Given your diagram, you want to move the parts along 4 paths at a certain rate and keep track of their progress. Have these paths’ directions be the LookVector and UpVector of the treadmill base part and their negatives.
A simple way to keep track of a part’s progress along a path is calculating their distance away from either an end point or starting point of a path and maybe comparing with the total length of the path. Which path the part is on should be kept track of and transitioned at the end of a path.
And so moving a platform would be, the starting position + direction * (progress or distance + rate).

For the rotations, they move along the base part so you would also use the look and up vectors to orient the parts along their path.
if you want to rotate at the corners with the rate, i might try using arc length to find an angle increment for axis angle rotation at a pivot.

as the other reply said, this isnt really trivial. if i only had to make this treadmill once and the treadmill doesnt change, i might go for animating the model instead.

1 Like

Hey, you think you could give me some sort of example possibly?

Sure. Here’s a picture

i’ll explain this later, if needed

1 Like

That makes a bit more sense.

So basically I would just loop through the platforms, and calculate the position of that platform of the current iteration, based on an end-point? And utilize UpVector, LookVector, and then for the back and down vector I would just ‘-’ the vector? So like -UpVector?

If you can, could you also give a code example possibly?