I’m trying to make an ADS system, and my MAIN obstacle is not being able to rotate the camera whenever the tool is equipped, also the camera NOT following the player’s head.
local plr = game:GetService("Players").LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local TS = game:GetService("TweenService")
local Humanoid = Char:WaitForChild("Humanoid")
local Tool = script.Parent
local Mouse = plr:GetMouse()
local camera = workspace.CurrentCamera
local time = 0.6
Tool.Equipped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = Char.Head
local pos = camera.CFrame
Mouse.Button2Down:Connect(function()
local AimIn = TS:Create(camera, TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {CFrame = camera.CFrame + Vector3.new(1,0,-1)})
AimIn:Play()
end)
Mouse.Button2Up:Connect(function()
local AimOut = TS:Create(camera, TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = pos})
AimOut:Play()
end)
end)
Tool.Unequipped:Connect(function()
camera.CameraType = Enum.CameraType.Custom
end)