I made this script that allows a player to freely look around while driving a vehicle. It also re-enables z-axis rolling (allows camera to tilt while driving)
handle = RunService.RenderStepped:Connect(function(_) --Update car camera every frame
local newRX, newRY, newRZ = copy.CFrame:ToOrientation() -- Get the new rotation of the car
local diff = newRX - lastRX
local diff2 = newRY - lastRY
workspace.CurrentCamera.CFrame *= CFrame.Angles(diff,diff2,newRZ) -- Add to camera's CFrame
lastRX, lastRY, lastRZ = copy.CFrame:ToOrientation()
end)
(“copy” is a part I welded to the face of the character)
For the most part, this script works just fine, but when looking straight up or down, the camera will rotate independently from the car. The effect is more apparent the farther up/down you are, with it being basically nonexistent looking straight forward. Here’s an example video:
Not really sure how to fix this…