Heyy, I was wondering if someone knows any better formula for the scaling on the viewbob intensity and speed based on the current WalkSpeed of the character , Because currently at high speeds, the viewbobbing doesn’t seems to be that noticeable (except the one modifying the X axis (angles) which is kinda crazy ), so if there’s a better way to adjust the Angles to be less noticeable on higher speeds or just be in resonance with the Y axis viewbobbing, i would like toknow
Also, i am using this spring module
task.wait(.1)
local players = game:GetService("Players")
local localplayer = players.LocalPlayer
local character = localplayer.Character or localplayer.CharacterAdded:Wait()
local HRP = character:WaitForChild("HumanoidRootPart")
local Hum = character:WaitForChild("Humanoid") or character:FindFirstChildWhichIsA("Humanoid")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Camera = workspace.CurrentCamera
local Spring = require(ReplicatedStorage.Libraries:WaitForChild("Spring"))
local abs = math.abs
local sin = math.sin
local cos = math.cos
local settings_ = {
1.25, 8, 65, 0, 0, 0
}
-- SPRINGS --
local CurrentSpring;
CurrentSpring = Spring.new(table.unpack(settings_)) -- 11 damp
CurrentSpring:SetVelocity(1.5)
local springX = Spring.new(table.unpack(settings_))
springX:SetVelocity(1.5)
-----------------------
RunService:BindToRenderStep("CameraBobble", Enum.RenderPriority.Camera.Value, function(delta)
local currentTime = tick()
local RootVelocity = math.round(Vector3.new(HRP.AssemblyLinearVelocity.X, 0, HRP.AssemblyLinearVelocity.Z).Magnitude)
-- FORMULA --
local Walk_Y = abs(sin(currentTime * (RootVelocity/2.71))) * .7 -- I've been experimenting with these but i can't seem to find a good setting
local Walk_X = cos(tick() * (RootVelocity/2.71)) * .6
--
-- IDLE FORMULA SOON... --
local Breathing_Y
local Breathing_X
--
if Hum.MoveDirection.Magnitude <= 0 then
springX:SetGoal(0)
CurrentSpring:SetGoal(0)
elseif Hum.MoveDirection.Magnitude > 0 then
CurrentSpring:SetGoal(Walk_Y * .90)
springX:SetGoal(Walk_X * 1.5)
end
Camera.CFrame *= CFrame.new(0, CurrentSpring.Offset, 0) * CFrame.Angles(0, 0, math.rad(springX.Offset))
--Camera.CFrame *= CFrame.new(0, Walk_Y * .80, 0)-- * CFrame.Angles(0, 0, math.rad(Walk_X * 1.5))
end)
How it looks right now :