How do I make the camera tilt smoothly and stay on the player?

This works, I’m going to try a more noticable angle now

I just remembered, the tween stops the camera from moving with the body

Here’s the entire current script.

local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local RS = game:GetService("RunService")
local Char = script.Parent
local Tilting = false
local Cooldown = false
local Camera = game.Workspace.CurrentCamera
local Connection


UIS.InputBegan:Connect(function(i,g)
	if i.KeyCode == Enum.KeyCode.E and not g and Cooldown == false then
		Cooldown = true
		delay(2,function()
			Cooldown = false
		end)
		if Tilting == true then
			TS:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = Camera.CFrame * CFrame.Angles(0,0,0)}):Play()
			delay(1,function()
				Char.Humanoid.AutoRotate = true
				Camera.CameraType = Enum.CameraType.Custom
			end)
			Connection:Disconnect()
		else
			Char.Humanoid.AutoRotate = false
			TS:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(160),0)}):Play()
			Camera.CameraType = Enum.CameraType.Scriptable
			Connection = RS.Heartbeat:Connect(function()
				print("Running")
				Camera.CFrame = CFrame.Angles(0,math.rad(160),0) + Char.Head.Position + Vector3.new(0,0.2,0)
			end)
		end
		Tilting = not Tilting
	end
end)

Does anybody still have an answer to this?

The closest I’ve gotten to making camera movement in first person like this is attaching the camera to the head, which doesn’t let you rotate the camera, good for cutscenes but not great for having “realistic” camera movement during gameplay.

Never closed this, oops. I figured this out a while ago, I just made my own camera module.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.