What do you want to achieve?
Multiple camera blocks, can press Q or E to cycle through the different camera angles. Camera angles are all fixed positions. Currently only have one camera angle.
What is the issue? Include screenshots / videos if possible!
No idea if I should tackle this - not very good at scripting, I’m more a builder!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Just had a little google around, had a look at some YouTube videos, had no luck.
local character = player.Character
local camera = workspace.CurrentCamera
repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.CameraPos.CFrame
local cameraNum = 1;
local maxCamera = 5;
local UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(function(key,state)
if not state then
if key.KeyCode == Enum.KeyCode.E then
cameraNum = cameraNum + 1;
if cameraNum == maxCamera then
cameraNum = 1;
end;
end;
if key.KeyCode == Enum.KeyCode.Q then
cameraNum = cameraNum - 1;
wait();
if cameraNum == 0 then
cameraNum = 1;
end;
end;
if cameraNum == 2 then
workspace.CurrentCamera.CFrame = workspace.Camera2.CFrame
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable;
elseif cameraNum == 3 then
-- and so on with the code
end;
end;
end)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local camera = workspace.CurrentCamera
local cameraPos = workspace:WaitForChild("CameraPos")
local uis = game:GetService("UserInputService")
repeat task.wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
uis.InputBegan:Connect(function(key, processed)
if processed then
return
end
if key.KeyCode == Enum.KeyCode.Q then
camera.CFrame = cameraPos.CFrame
end
end)
uis.InputBegan:Connect(function(key, processed)
if processed then
return
end
if key.KeyCode == Enum.KeyCode.E then
camera.CFrame = hrp.CFrame * CFrame.new(0, 20, 0)
end
end)
Triggered when the “Q” key is pressed. The “E” key focuses the camera on the player’s character model.