[SOLVED] Help on infinite road

Just saying, I love what you’re doing and the concept, is it possible you could just simulate it in the game, like the wheels moving and the terrain switches so you don’t actually have to physically move in the game, I’ve had problems with this before and it’s super hard sometimes to get around this.

That is exactly what I am doing here. The wheels rotating the the ground moving in a specific direction. Plus in Bus Simulator it does the exact same thing and I found proof of it.

Hmm, quite tricky, so are landscapes the only big concern?

1 Like

If you are talking about only the road then yes. Once i get the road figured out I believe I can do the landscaping as well

I dont know if this helps any but this would make an infinite road if you only use that one part:

local PreviousPos = nil

for i = 1,100 --change 100 to the amount of times you want this looped

local ClonedPart = game.Workspace.Model4.Part:Clone()

ClonedPart.Parent = workspace
if PreviousPos == nil then
ClonedPart.CFrame = CFrame.new([POSITION OF START])
PreviousPos = ClonedPart.Position
else
ClonedPart.CFrame = CFrame.new(PreviousPos)+Vector3.new(ClonedPart.Size.X,0,0) -- this would generate a part infront of the previous one.
PreviousPos = ClonedPart.Position
wait(0.1)
end
end

Again idk if this is what you were trying to accomplish but let me know C:

2 Likes

Yeah well, I found out how to do endless terrain, but I’m pretty sure rendering would be a HUGE problem.

Actually that looks good but i have 2 questions

  1. Would i just delete all my other scripts and put this under
game.workspace.Model4.InfiniteRoad
  1. cant i just do a while true do
  1. yea you could just delete the other scripts

  2. Of course! instead of for i = 1,100, change the to while wait(0.1) do

however this may cause some lag since its loading a lot of parts haha

EDIT: you can place the script I made in ServerScriptService

If possible to reduce lag, you could have it teleport them to the start of the road and repeat to try and reduce lag for not so powerful computers. I see problems with the smoothe-ness of switching but it could work.

If you haven’t already tried it, and if i get your goal wrong, what you could try is making something like the Endless Staircase from SM64, instead of actually being endless, there was a collidable block that when hit would teleport you back, which gave the sense that it was actually endless, without being actually endless.

Exactly, and you could outreach the landscape if you want the road cycle to go on longer to reduce seeing the same objects, I’m pretty sure that’s what desert bus VR did.

ok then here we go.

local road = {}
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
       while true do
            if road[char.HumanoidRootPart.X] == nil then
                makeroad(char.HumanoidRootPart.X)
                road[char.HumanoidRootPart.X] = true
            end
        end
    end)
end)
2 Likes

All good, good luck with you’re game it’s very good :slight_smile:

@Revelted (sorry for another mention lol) I am doing your method now but in a new model named Model4B I will include what the outcome is as an edit here anything that was named in scripts or outside of them will also have the letter “B”

Delete everything.

30 characters

oh ok good you do have the same time zone
alright imma delete that other comment after i try rev’s method I aint going to do a third mention lol i will try yours next even if rev’s method worked NOT A FOURTH REEEEEE

your method will be named Model4C and same way with the other stuff

Instead of “B” it a “C”

your method will be named Model4C and same way with the other stuff

Instead of “B” it a “C”

merging this comment with the comment up top to make this comment section look more neat

@Revelted Your script has been finished but it is not cloning nor moving. I changed the naming stuff correctly to have the letter B but nothing is happening

Newly changed script
local PreviousPos = nil

for i = 1,100 --change 100 to the amount of times you want this looped

local ClonedPart = game.Workspace.Model4B.PartB:Clone()

ClonedPart.Parent = workspace
if PreviousPos == nil then
ClonedPart.CFrame = CFrame.new([POSITION OF START])
PreviousPos = ClonedPart.Position
else
ClonedPart.CFrame = CFrame.new(PreviousPos)+Vector3.new(ClonedPart.Size.X,0,0) -- this would generate a part infront of the previous one.
PreviousPos = ClonedPart.Position
wait(0.1)
end
end

Notice i put the letter “B” in some places in line 3
If you believe there is a solution to this let me know I have left it still for about 10 seconds and moved the Model4B around for 10 seconds as well (ending the first test obviously)

I am not trying to confuse you with unreasonable questions but I only put in the “B” due to wanting to keep all versions and seeing which version is the best.

This is how i put in your script (@Dev_HDWC this is how I will put in your script as well)
Capture2

@Dev_HDWC Your script has been finished but it has the same effect as rev’s. Here is the newly made script but I am not sure if I was supposed to rename anything due to me having a part named road and you told me to delete my other scripts and blah blah blah

Newly changed script
local road = {}
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
       while true do
            if roadC[char.HumanoidRootPart.X] == nil then
                makeroadC(char.HumanoidRootPart.X)
                roadC[char.HumanoidRootPart.X] = true
            end
        end
    end)
end)

Notice where you put “road” i put the letter C afterwards. But I also noticed that your script involves the player itself. I am going to click play on my test server and see what happens. (fyi if your script was for a multiplayer server let me know now because I’m making a single player game)

you have spelt road wrong my friend. and makeroad
road not roadC