Hi I can’t seem to get the player camera to tilt no matter what I seem to do. Currently the camera just turns normally without tilting or rolling. I’ve tried messing around with the values, reformatting several times, switching out parts here and there and nothing seems to affect the angle.
There doesn’t seem to be anything wrong with the drift value or radFunction(Drift*100) itself cause it returns somewhat reasonable numbers. No error messages are being created either so I’m kinda at a loss at what to do now.
Some other stuff I’ve tried
- switching between fromOrientation, .angle,
- moving the tilt directly into the fromOrientation instead of multiplying
- replacing radFunction(Drift*100) with constants both high and low
At this point I’ve spent hours and I still can’t figure this out I’d really appreciate so much if someone spotted something I’m missing. Sorry if it’s something really obvious…
function Camera.Update(dt)
for _, bodyPart in LocalCharacter:GetChildren() do
if (bodyPart:IsA('BasePart')) then
bodyPart.LocalTransparencyModifier = 0
end
end
Limiter += dt
if Limiter >= 1/Settings.Rate then
t = clock()
local rawDelta = Input:GetMouseDelta()
local delta = rawDelta*sensitivity*100
targetX -= delta.X
targetY = clamp(targetY-delta.Y,-80,80)
current = current:Lerp(Vector2.new(targetX,targetY), dt*speed)
Drift = GetMouseDrift(Drift, rawDelta*100, dt)
local NewCamera = CFrame.new(Head.CFrame.Position) *CFrame.fromOrientation(current.Y/rad,current.X/rad,0)
* CFrame.Angles(0,0,radFunction(Drift*100))
CurrentCamera.CFrame = NewCamera
Humanoid.CameraOffset = Vector3.new(0,0,-1)
Limiter -= 1/Settings.Rate
end
end
Tilting line is specifically this one:
* CFrame.Angles(0,0,radFunction(Drift*100))