I would like this code to follow my head (Similar to TSB cam) While keeping the same properties it has now. I also need help making it more smooth and other things, Thank you in advance.
Here’s the code:
--Services
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
--Player & Character
local plr = game:GetService("Players").LocalPlayer
local Character = plr.Character or plr.CharacterAdded:Wait()
local hum = Character:WaitForChild("Humanoid")
local hrp = Character:WaitForChild("HumanoidRootPart")
--Other
local Camera = game:GetService("Workspace").CurrentCamera
function Update()
TweenService:Create(hum, TweenInfo.new(0.75, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CameraOffset = (hum.MoveDirection) * 2}):Play()
if hum.MoveDirection.Magnitude <= 0 then
TweenService:Create(hum, TweenInfo.new(0.75, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CameraOffset = (Vector3.new(0,0,0))}):Play()
end
end
runService.RenderStepped:Connect(Update)