You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
Make the camera smoothly tilt in the direction the player is walking in,like if the player presses D it goes a little right
- What is the issue? Include screenshots / videos if possible!
Everything i tried did not work,only fully copying the script worked but it doesn’t fully do what i want it to
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried finding stuff on devhub but the only thing i found makes the camera teleport (the script below)
The script i found:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local function GetRollAngle()
local Character = Player.Character
if not Character then
return
end
return Camera.CFrame.RightVector:Dot(Character.Humanoid.MoveDirection)
end
RunService:BindToRenderStep("RotateCameraInDirectionPlayerIsGoing", Enum.RenderPriority.Camera.Value + 1, function()
local Roll = -GetRollAngle()
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,0,Roll)
end)
Is there any way to edit this script so it would tilt smoothly and not just teleport?