Horror Camera with Limited FPS

I’m making a cool little horror game that only allows you to see the creatures with your camera.

9 Likes

What do you use for loops, can you send your code?

@absentdenik bro what.
This looks cool, sadly I don’t think there’s a way to build a screenshot system that saves photos in game. If you find a way, it would be cool of you to post it. Cool UI.

Viewports, the best way would be copying map regions to your viewport once and constantly updating moving objects position.

Not gonna lie, some static or VHS effect would look cool.

RunService.RenderStepped:Connect(function()
	if tick() >= tac+pause then
		tac = tick()
		camera.CFrame = cam.PrimaryPart.CFrame*CFrame.new(0,0,-zoom)
		for i,v in pairs(vp:GetChildren()) do
			if v then
				v:Destroy()
			end
		end
		for i,v in pairs(workspace:GetDescendants()) do
			if v then
				if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
					if v ~= cam:FindFirstChild("Handle") and v ~= cam:FindFirstChild("Lens") and v.Parent ~= Players.LocalPlayer.Character and v.Parent.Parent ~= Players.LocalPlayer.Character then
						local y = v:Clone()
						y.Anchored = true
						y.Parent = vp
						if y.Name == "Scopo" then
							y.Transparency = 0
						end
					end
				end
			end
		end
	end
	if camEquip == true then
		cam.Parent = workspace
		local CF = workspace.CurrentCamera:GetRenderCFrame()
		cam.PrimaryPart.CFrame = CF*CFrame.new(0,0,-1.25)*script.Parent:FindFirstChild("Offset").Value
	else
		cam.Parent = script.Parent
	end
	if z == true then
		cam:FindFirstChild("Handle"):FindFirstChild("Zoom"):Play()
	else
		cam:FindFirstChild("Handle"):FindFirstChild("Zoom"):Pause()
	end
end)
2 Likes

not the same thing as a system where you save photos :person_shrugging:
I’ve tried, but I’m pretty sure it’s a security risk for Roblox to store player screenshots in their games.
Viewports aren’t what I was talking about.

1 Like

You can use raycast to save low resolution photos. Viewports would also work as long as you optimize it, however u still have to serialize all the objects and save them.

2 Likes

Raycasting would be super laggy but yeah. That was my only idea, but I hate raycasting. The resolution would depend on how big the frames you use to show to picture are yeah. It would just be the most annoying thing ever to save. But it would be simulating a real camera.

I’d just make it save the current viewport frame that it’s showing.