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