You can but the material if applied won’t move which kind of ruins the illusion. Also moving the entire road overall is a better idea because who knows that the OP could be using 3d lines?
I want trees and other structures to pass by as well. the reason I want a tile system is I can make presets and areas(biome in a sense)
I plan on making areas such as highway/freeway or backside country roads. I can do all of that I just don’t know where to start on the moving mechanic cause it involves cframes(I am not good with frames)
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Map = game.Workspace:WaitForChild("Map")
local roads = {}
local roadsize = 123
local roadlength = 5
local roadspeed = 2
local roadtween = TweenInfo.new(roadspeed,Enum.EasingStyle.Linear)
-- Start Generation
if #Map.CenterRoad:GetChildren() ~= roadlength then
local initalstart= ReplicatedStorage.Road:Clone()
initalstart.Parent = Map.CenterRoad
initalstart.Name = "Road1"
local amount = 1
for i = 1,roadlength-1 do
local rdcl = ReplicatedStorage.Road:Clone()
rdcl.Parent = Map.CenterRoad
rdcl:SetPrimaryPartCFrame(CFrame.new(-9,0,roadsize*-amount)*CFrame.Angles(0,-math.pi/2,0))
rdcl.Name = "Road"..amount + 1
amount += 1
end
for _, i in pairs(Map.CenterRoad:GetChildren()) do
table.insert(roads,i)
end
end
-- move backward
while true do
for _, i in pairs(roads) do
if i.PrimaryPart.Position.Z >= roadsize then
local index = table.find(roads,i)
table.remove(roads,index)
i:Destroy()
else
local moveroadlmao = TweenService:Create(i.PrimaryPart,roadtween,{["CFrame"] = CFrame.new(i.PrimaryPart.Position+Vector3.new(0,0,roadsize))*CFrame.Angles(0,-math.pi/2,0)})
moveroadlmao:Play()
end
end
task.wait(roadspeed)
end