How would be able to move a first person mode camera by using a localscript?
What do you mean by move first person mode Isaiah?
repeat
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
Then just set the CFrame of the camera to move it.
When changing the camera movement mode, add a task.wait() before it, so you don’t get the ActivateCameraConroller did not select a module error
You can do that by simply moving the camera every frame after the camera modules finish CFrameing .
It isn’t necessary to set camera to scriptable if all you want to have camera shake or something similar.
Bind to RenderStepped is a useful function to use here.
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local sin = math.sin
local rad = math.rad
local x = 0
local Camera = workspace.Camera
local Player = Players.LocalPlayer
local Character: Model = Player.Character or Player.CharacterAdded:Wait()
local Humanoid: Humanoid = Character:WaitForChild("Humanoid")
RunService:BindToRenderStep(
"CameraManipulate",
Enum.RenderPriority.Camera.Value + 1,
function(DeltaTime)
if Humanoid.MoveDirection.Magnitude > 0 then
x += DeltaTime * 10
Camera.CFrame *= CFrame.Angles(0,0,rad(sin(x)) * 10)
else
x = 0
end
end
)
Player.CharacterAdded:Connect(function(character)
Character = character
Humanoid = Character:WaitForChild("Humanoid")
end)
I created this a while back it isn’t really polished but hopefully you get the idea.