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
i think i found it - they use the humanoid property CameraOffset - Requesting Help to Implement 'Saitama Battlegrounds' CameraSubject on Torso Without Jittery Effect!
so just position the cameraoffset on the y vector to the position of Torso, u can tween it
-- //Services
local Players = game:GetService("Players")
-- //Player
local player = Players.LocalPlayer
-- //Character
local character = player.Character or player.CharacterAdded:Wait()
-- //BaseParts
local Torso = character:FindFirstChild("Torso")
-- //Humanoid
local Humanoid = character:FindFirstChild("Humanoid")
Humanoid.CameraOffset = Vector3.new(0, Torso.Position.Y, 0) --// Something like this!
That could work but i think they lerp the camera to that position because it does seem like it
idk about lerping - this is an example on what they do
-- //Services
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
-- //TweenService
local TweenInfo = TweenInfo.new(0, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
-- //Player
local player = Players.LocalPlayer
-- //Character
local character = player.Character or player.CharacterAdded:Wait()
-- //BaseParts
local Torso = character:FindFirstChild("Torso")
-- //Humanoid
local Humanoid = character:FindFirstChild("Humanoid")
-- //Animator
local Animator = Humanoid:FindFirstChild("Animator")
-- //Animation being played
local LoadAnimation = Animator:LoadAnimation()-- //Animation
-- //Tween
local TweenOffset = TweenService:Create(Humanoid, TweenInfo, {CameraOffset = Vector3.new(0, Torso.Position.Y, 0)})
TweenOffset:Play()
TweenOffset.Completed:Wait()
LoadAnimation:Play()
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