I need help with my camera system

Using my script, I guess you can achieve something like this:

local partA = workspace:WaitForChild("PartA",10) --Set the two parts.
local partB = workspace:WaitForChild("PartB",10)

local player = game.Players.LocalPlayer

local camera = workspace.CurrentCamera

local cframes = { --Customise the parts' CFrames to set the camera to.
    ["CFrameA"] = {
        ["Position"] = {0,20,0},
        ["Orientation"] = {0,-90,0}
    },
    ["CFrameB"] = {
        ["Position"] = {0,40,0},
        ["Orientation"] = {0,-90,0}
    },
}

camera:GetPropertyChangedSignal("CameraType"):Wait()
camera.CameraType = Enum.CameraType.Scriptable

partA.Touched:Connect(function(otherPart)
    if otherPart.Parent:FindFirstChildOfClass("Humanoid") then
        camera.CFrame = CFrame.new(cframes.CFrameA.Position[1],cframes.CFrameA.Position[2],cframes.CFrameA.Position[3]) * CFrame.Angles(math.rad(cframe.CFrameA.Orientation[1]),(math.rad(cframe.CFrameA.Orientation[2]),(math.rad(cframe.CFrameA.Orientation[3]))
    end
end)

partB.Touched:Connect(function(otherPart)
    if otherPart.Parent:FindFirstChildOfClass("Humanoid") then
        camera.CFrame = CFrame.new(cframes.CFrameB.Position[1],cframes.CFrameB.Position[2],cframes.CFrameB.Position[3]) * CFrame.Angles(math.rad(cframe.CFrameB.Orientation[1]),(math.rad(cframe.CFrameB.Orientation[2]),(math.rad(cframe.CFrameB.Orientation[3]))
    end
end)

Here’s what I use to mimic Resident Evil 1’s camera system. I used a LocalScript in StarterCharacterScripts. You can add multiple parts if you choose, and when it’s touched, it will snap to that position in a fixed mode.

task.wait(.1) -- Wait for part to load in
local pos = Vector3.new(0, 10, 0) --Position of the camera
local lookAtPos = Vector3.new(10, 0, 0) --Angle the camera is looking at
local cameraCFrame = CFrame.lookAt(pos, lookAtPos)
local camera = workspace.CurrentCamera
local camPart = workspace.CamTP --Part that changes the camera position when touched

camPart.Touched:Connect(function(hit)
    camera.CameraType = Enum.CameraType.Scriptable
    workspace.CurrentCamera.CFrame = cameraCFrame
end)
3 Likes

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