Inf spawning map

I was wondering if there was a way to script my map to keep spawning inf infront of the old map like this game:

An Infinite Road Trip - Roblox (OFC I am not remaking the game but I am trying to make something similar for a event I am hosting with my server)

Any answers will help.

This is my workspace
Screenshot 2023-04-24 104927

1 Like

Create a while loop that clones the previous map’s position. This is an example of what you could do(using a part, however).

local part = workspace.Part
local lastPart = part

while true do
	local clone = part:Clone()
	clone.Position = lastPart.Position + Vector3.new(-1*clone.Size.X,0,0)
	clone.Parent = game.Workspace
	lastPart = clone
	task.wait(1)
end

Is there a way to do this with a model I am trying to figure it out but I can’t

Use the PivotTo function to move the model to the desired position.

I am I really noob at this stuff ill try it tho

What they should actually do is this

Make a local script and get a model. 0 represents the model they are currently on. Generate 3 models which is -1, 0, and 1

once they touch model 1
Bump everything up and remake the -1,0, and 1

same when they touch model -1

One thing that you can do is create a model of the road (add some parts for scenery, etc…) nad have 5 copies of it. On the middle segment, use a spatial query function like game.Workspace: GetPartBoundsInBox() on the middle segment only about 10 times a second. When the vehicle leaves the segment, move the query to the next segment and move the last segment to be in front using Model:PivotTo(). You can just keep doing that forever.

The caveat though is that at some point, you are going to have to move the entire structure back to origin because the coordinate numbers will get too high.

I only created this thread to see how to I was open to any idea’s even not :clone maybe a way to move the part.

If you are moving a model, then :PivotTo(CFrame) is what you use. If you are moving a part, you can use Part.Position(Vector3) to change it’s position.