I want to figure out how to make the camera tilt smoothly, probably with a tween, while also not being locked in place.
What is the issue?
Every time I have attempted something like this the camera is either choppy, gets locked in place, or doesn’t work at all.
What solutions have I tried so far?
I have tried solutions multiple times on this forum but none of them were what I was looking for.
I would like an example script that would show how to do this, I am not asking for an entire system I am just asking for, maybe a button press rotates the camera a little bit or something, I could just edit it from there, any and all help is appreciated, thanks.
Ah, no, not that. When a button is pressed the camera would rotate (It doesn’t matter where since it could just be edited afterwards.), It doesn’t have to be on a button press, it should just be there’s a time where it’s tilted and not titled. It would not be a constantly moving thing, it would only move until the tween would finish
Ok so right now it does not move the camera at all, the angle is just a test number right now
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local Tilting = false
local Cooldown = false
local Camera = game.Workspace.CurrentCamera
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,100,0)})
elseif Tilting == false then
TS:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = Camera.CFrame * CFrame.Angles(0,0,0)})
end
Tilting = not Tilting
end
end)
game:GetService("RunService").RenderStepped:Connect(function()
if Tilting == true then
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,100,0)
end
end)
If I remove the ToOrientation check, I spin around constantly (In first person).
game:GetService("RunService").Heartbeat:Connect(function()
if Tilting == true then
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(10),0)
end
end)