Infinite floors?

How would I make an infinite floor system? think of something like dandysworld or something possibly even floors but i dont think they use the same mechanics,
I already have one map done ill make the rest but I dont know where to begin which script to use and how it would work?? any help would be Thankfulled to the limit.

Suphi has a video on something similar, its not floors, but stages in an obby.

You’ll have to change it up a bit to make it for floors.

Here’s also one about procedural generation, but its rooms, you’ll just have to adjust it to you’re project again:

2 Likes

Thinking off the top of my head, here is what I would do.

I would probably use a while true do loop which will infinitely run unless otherwise told so.

Then, the next step would be to create a set of pre-made floors and place them in a folder in ServerStorage or ReplicatedStorage

You would also need math.random(1,n) - n being how many pre-made rooms you have or another approach would be to do floors:GetChildren and the floors would be the folder with the pre-made floors.

Then, you would also need to set an offset for where to place the pre-made floor above each preceding floor as well as setting the cloned floor’s parent to workspace. Here is a really vague example of what my code would look like altogether:

local ServerStorage = game:GetService("ServerStorage")
local floors = ServerStorage.Floors

local created_floors = game.Workspace.Created_Floors --Make a new folder in Workspace

while true do
    local cloned_floor = math.random(1, floors:GetChildren()):Clone()
    cloned_floor.Parent = game.Workspace

    previous_floor_position = cloned_floor.CFrame
    
    --You would then add 10 to the Y value of the next floor
    cloned_floor.CFrame = previous_floor_position + Vector3.New(0, 10, 0) -- Y value can be adjusted depending on how tall floors are

    task.wait(0.001) --This prevents crashing of the game
end

This is an extremely vague example and probably contains multiple errors. If there is any feedback on this anyone would like to give me then I will be very happy to receive it so that I may improve my coding skills!

1 Like

in dandy’s world (ive only played once so idk) i think they probably just load one floor at a time. whenever you’re ready to load the new floor, just replace the old one with it.

2 Likes

thank you all so much you are all so nice i hope you get good karma from this i hope you get blessed for helping me thank you

2 Likes