How do i make a camera system like doom 1993

how would i make a camera system like or as doom 1993. the camera cant be moved on the y axis. please help!

1 Like

Can you send a snippet with the code you have for managing the camera? It should be able to move on the Y axis.

1 Like

you’d need to track the players position and constantly set the camera CFrame there. as for rotation, you’d have to check the mouse delta (mouse positional change) on the horizontal axis, i believe its the X axis. based on the change of the mouse delta, you can just rotate the camera left or right based on if the value is positive or negative

1 Like

To make a camera system like the one in Doom 1993 in Roblox, you will need to use the built-in camera object and a script to control its movement. Here is an example script that you can use to create a fixed camera that can only move on the x and z axes, similar to the camera in Doom:

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

--Set the camera to a fixed position and rotation
camera.CFrame = CFrame.new(character.HumanoidRootPart.Position + Vector3.new(0, 20, 0), character.HumanoidRootPart.Position)
local lastPos = camera.CFrame

--Move the camera to follow the player's x and z position
while true do
    local newPos = character.HumanoidRootPart.Position + Vector3.new(0, 20, 0)
    camera.CFrame = CFrame.new(Vector3.new(newPos.x, lastPos.p.y, newPos.z), character.HumanoidRootPart.Position)
    lastPos = camera.CFrame
    wait()
end

This script first sets the camera’s CFrame to a fixed position and rotation, which is 20 units above the player’s character’s root part, and looking directly at the root part. Then it creates an infinite loop that runs every frame. Inside the loop, it updates the camera’s position so that it follows the player’s x and z position while keeping the y position fixed.

This script will not be able to change the camera’s y position, it will keep it fixed at 20 units above the character’s root part.

Please note that the script above could cause some lag, you may want to optimize it by implementing a raycast in front of the character to determine if there is any obstacle in front of the character.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.