As you can see from the video, when I move the camera without aiming in, it doesn’t aim in where the camera was originally looking. Here is my code
Info.Angles = {X=0;Y=0;}
Info.Offset = Vector3.new(2, 2, 4)
function Info.Run.Init()
Info._cas:BindAction("PlayerInput", function(Action, State, IObject)
if State == Enum.UserInputState.Change then
Info.Angles.X -= IObject.Delta.X * 0.025
Info.Angles.Y = math.clamp(Info.Angles.Y - IObject.Delta.Y * 0.025, -25, 25)
end
end, false, Enum.UserInputType.MouseMovement, Enum.UserInputType.Touch)
end
Info.Run.Start = function(...)
Info.Task = RunService.RenderStepped:Connect(function(dt)
local Character = game.Players.LocalPlayer.Character
if Character and Character:FindFirstChild("HumanoidRootPart") then
Info.ClientFuncs:CharacterToCamera()
local HRP = Character:FindFirstChild("HumanoidRootPart")
local sCF = CFrame.new((HRP.CFrame.Position)) * CFrame.Angles(math.rad(Info.Angles.Y), math.rad(Info.Angles.X), 0)
local cCF = sCF:ToWorldSpace(CFrame.new(Info.Offset.X, Info.Offset.Y, Info.Offset.Z))
local cDir = sCF:ToWorldSpace(CFrame.new(Info.Offset.X, Info.Offset.Y, -10000))
local Alpha = math.clamp(0.2 * 60 * dt, 0, 1)
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:Lerp(CFrame.new(cCF.Position, cDir.Position), Alpha)
end
end)
Info.Camera:SetType("Scriptable")
Info.Camera:TweenFov(45);
Info.State = true
end```