I’m so baffled as to how ROBLOX’s shiftlock works, I use the same camera script but get different results when I switch between shiftlock and normal camera, little imperfections and inconsistencies that no one has made topics of.
What I want:
What I actually have:
The code I use:
local cf: CFrame = CFrame.lookAt(Player.Character.HumanoidRootPart.Position, Vector3.new(workspace.Camera.CFrame.LookVector.X * 90000, workspace.Camera.CFrame.LookVector.Y * 90000, workspace.Camera.CFrame.LookVector.Z * 90000))
offset = cf:PointToObjectSpace(Player.Character.Head.Position)
if Player.Character:HasTag("Welded") then
HeadFocus = Vector3.new(offset.X, offset.Y - 1.5, -offset.Z)
else
local cf: CFrame = Player.Character.HumanoidRootPart.CFrame
offset = cf:PointToObjectSpace(Player.Character.Head.Position)
HeadFocus = Vector3.new(offset.X, offset.Y - 1.5, -offset.Z)
end
It uses lerp and then applies it to Humanoid.CameraOffset:
local Scaler = math.clamp((dt * 0.5) * 25, 0, 1)
local LerpHeadFocus = Player.Character.Humanoid.CameraOffset:Lerp(HeadFocus, Scaler)
The camera script is binded to Renderstep, priority 201.
If you don’t get it, I’ll tell you. The camera in my game when moved to a top down perspective will make certain errors, like when the position of the head is clearly inching towards a certain axis, the camera would instead inch towards anywhere but there.
In the strongest battlegrounds however, the camera seems to perfectly smooth to the player’s head position no matter the circumstance, which is the effect I want.
And no I do not want to use camera.CameraSubject as the lack of smoothing looks like it would give someone motion sickness, help is appreciated!!!
I think it looks great! Try to make your own way of making stuff like the camera shakes. Like i said i think it looks amazing. And if you reallyyyy want to make it like tsb then you would actually just play around with the values.
Yes this is what they do and it leads to no weird camera problems. Would recommend modifying the base camera script. There should be a function called GetSubjectPosition that you can modify, that’s what I do for my game.