Hello, this is a tutorial on how to create backrooms like game. There are many methods to create a game like this, but I find this one the easiest to make. I will try my best to describe the steps in a detailed, and easy-to-follow manner.
STEP ONE: The first step is to add a part into your place. This will act as a “Placeholder” for chunks of generated tiles. The part needs be 1 stud tall and should be a perfect square. (I would recommend a 100 x 100 stud square). Rename this part “Placepart”, and set CanCollide to off. Make sure this part is anchored.
STEP TWO: Next, you need to create a grid of these placeholders. This is where you decide how big you want your backrooms map to be. I will use a 4x4 grid for demonstration. MAKE SURE YOUR PLACEHOLDERS DO NOT INTERSECT!!! (you do not need to color, this is for demonstration)
STEP THREE: Next, create a folder and stuff it into ReplicatedStorage. Rename the folder “Places”. Then you need to transfer the Placeparts into this folder.
STEP FOUR: Create a model in the workspace. Then, duplicate one of the Placeparts from the folder in the previous step, and put the part in the model. Rename this part “Floor”. Then make sure that can collide is enabled for this part. IMPORTANT: Set the model’s PrimaryPart to the floor.
STEP FIVE: Duplicate the floor, and move it up. Rename the duplicate “ceiling”. Again, make sure CanCollide is enabled. You can make this as tall as you want. Add your lights, walls, and other stuff you would like to add. Make sure this stuff is anchored and inside the model. I also forgot to mention this in the last step, but you can name the model whatever you want.
STEP SIX: Create another folder in ReplicatedStorage. Rename this folder “Rooms”, then place your model from earlier into the folder.
STEP SEVEN: Add a script into ServerScriptService. Type this into the script.
local rooms = game.ReplicatedStorage:WaitForChild("Rooms"):GetChildren()
for i, placeHolder in pairs(game.ReplicatedStorage.Places:GetChildren()) do
local chosenRoom = rooms[math.random(1,#rooms)]:Clone()
chosenRoom.PrimaryPart = chosenRoom.Floor
chosenRoom:SetPrimaryPartCFrame(placeHolder.CFrame)
placeHolder:Destroy()
chosenRoom.Parent = game.Workspace
end
HOW THE CODE WORKS: The script basically randomly picks a room you’ve placed into the folder, duplicates it, and aligns the PrimaryPart with one the placeparts.
When play-tested, you should have something like this.
FINAL STEP: Congrats! You’ve completed the hard part of this tutorial. Now, you duplicate your room in ReplicatedStorage, and create new rooms and walls. Remember to stuff these new rooms back into the folder. Have fun creating your new backrooms game!
If you have questions or suggestions please add them into the comments, thank you!