[Please help] How to fix 2d camera and how would I make or mint generated rooms

two questions I found this script on the toolbox for a 2d game but the problem is that the camera is on the other side I tried flipping the map but it doesn’t work. My other question is how would generate rooms for example I was thinking of multiple folders in Replicated storage Ex; room, misc, door, in those folders are different variations and colors similar objects that are in that folder to how NFTs are minted. I suck at explaining I hope u get what I’m saying if you didn’t I’m very sorry.


(This is what I want the camera to look like)


(This is how it comes out)

Code for 2d camera (Ps isnt mine)

local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer

camera.CameraType = Enum.CameraType.Scriptable

local targetDistance = 30
local cameraDistance = -30
local cameraDirection = Vector3.new(-1,0,0)

local currentTarget = cameraDirection*targetDistance
local currentPosition = cameraDirection*cameraDistance

game:GetService("RunService").RenderStepped:connect(function()
	local character = player.Character
	if character and character:FindFirstChild("Humanoid") and character:FindFirstChild("HumanoidRootPart") then
		local torso = character.HumanoidRootPart
		camera.Focus = torso.CFrame
		if torso:FindFirstChild("FastStart") == nil then
			camera.CoordinateFrame = 	CFrame.new(Vector3.new(torso.Position.X, torso.Position.Y + 10, torso.Position.Z - 20) + currentPosition, 
										Vector3.new(torso.Position.X,  torso.Position.Y, torso.Position.Z - 20) + currentTarget)
		else
			--Lower camera for fast start
			camera.CoordinateFrame = CFrame.new(Vector3.new(torso.Position.X, torso.Position.Y - 15, torso.Position.Z - 20) + currentPosition, 
											    Vector3.new(torso.Position.X,  torso.Position.Y - 15, torso.Position.Z - 20) + currentTarget)
		end
	end
end)

I basically want to know how to make the camera position similar to the game glass on roblox

Try this.
https://developer.roblox.com/en-us/onboarding/controlling-the-players-camera/2

1 Like

do you know how I would do this aswell

only tutorial I could really find on your question about generating rooms

1 Like

Thanks I tried using the runner game in roblox studios but I’m not sure on how to randomize the color of the room like tweening the wall color so it transitions between one color to another, similar to a gradient.