So, I wanted to recreate a camera system, where it follows the character in delay. I wanna use CameraOffset (The local Humanoid property, which adds offset to the camera, when the subject is the Humanoid.), however I cant really seem to get the offset to work how I want to (it sometimes gets offsetted to the left more and also just doesn’t allow for the player to spin around well)
Have you searched the forums for a solution?
I’m definitely no pro when dealing with this, but I just tried googling roblox tutorial camera spring scripting and found quite a few videos and forum posts about this subject.
I’ve seen a variant of this where it sets the subject as the part that follows, however that erradicates first person and shift lock. Though, you reminded me about Spring Modules, and I think those could do the trick.
I’m pretty sure this was caused because you were getting the offset in world space instead of the object space, which made the camera move in the wrong direction (ej. if you were moving left in the world space, and your character was facing the left, then it SHOULD be the front of your character, but it would still move to the left because its not relative to it)
My code
--!strict
local RunService = game:GetService("RunService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid") :: Humanoid
local root = character:WaitForChild("HumanoidRootPart") :: Part
local oldCFrame = root.CFrame
RunService.RenderStepped:Connect(function(dt: number)
local currentCFrame = root.CFrame
local offset = currentCFrame:ToObjectSpace(oldCFrame)
humanoid.CameraOffset = humanoid.CameraOffset:Lerp(offset.Position * 2, dt * 5)
oldCFrame = currentCFrame
end)