How do i make my camera module like a battlegrounds game i tried setting the Camera subject to the torso but its wayy to much so im wondering how they do it
They attach it to humanoidrootpart, not the torso or head.
When its attached to the root part it doesn’t move with the torso like it does in other battleground games
this should work simply setting CameraSubject to characters torso through camera. Im confused by you saying
When you set the camera subject to the torso its much more “wiggly” and some animations look weird but it still does seem like these games track the torso just in a much smoother way
That could work but i think they lerp the camera to that position because it does seem like it
They use an invisible part that acts like a “camera” so when you slash or move around the invisible part is animated too, it’s mostly animations hence the invisible part, stuff like camera shaking through walking can be done through animations or just linear math.
Try this code:
task.wait(1)
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum: Humanoid = char:WaitForChild("Humanoid")
local rootpart: Part, head: MeshPart = char:WaitForChild("HumanoidRootPart"), char:WaitForChild("Head")
game:GetService("RunService"):BindToRenderStep("CameraOffset", Enum.RenderPriority.Camera.Value - 1, function()
local cameraOffset = (rootpart.CFrame + Vector3.new(0, 1.75, 0)):PointToObjectSpace(head.Position)
game:GetService("TweenService"):Create(hum, TweenInfo.new(0.1), {CameraOffset = cameraOffset}):Play()
end)
This should work. Put the code in a local script which will be inserted in StarterCharacterScripts.
Wouldn’t creating a tween every render be unnecessary and laggy
It’s not laggy, thus making it useable. How do you think it’s going to be laggy?
Creating tweens is expensive and also it dosent look like a battlegrounds camera
How come creating tweens is expensive, and why doesn’t it look like the TSB camera? Give me a video, and I will solve it right away.
ik this is 20 days ago but i continued to look into it i found 2 solutions one of them is yours but they both suffer fro mthe same issue they break when shiftlock is on
Connection = sRunService.RenderStepped:Connect(function()
Humanoid.CameraOffset = Humanoid.CameraOffset:Lerp(Character.HumanoidRootPart.CFrame:toObjectSpace(Character.Head.CFrame).Position + Vector3.new(0,-1.25,0), 0.11)
end)
That’s exactly what i did but it breaks with shiftlock as i explained above
Make a custom shiftlock system
Hmm… Wait. I had the same issue. Maybe the shift lock uses CameraOffset too. Disable the shift-lock and see if it fixes it.
Yeah obviously that fixes it but I can’t disable shiftlock because it’s a necessity in my game
track when shift lock gets enabled and when it is, add shift lock position offset to the goal position during update
Tried it it dosent work what i suspect is that maybe camera offset works differently with shiftlock