what methods could I use to recreate it? im still trying to learn camera math and such and cant figure this out. I also wonder how to use the right stick on the gamepad to pan the camera around like this https://gyazo.com/326ff28bb35ddb375ce482b089802acd
-- local script obviously
local springs = require(path.to.module)
local sway = springs:create()
local function getSway(addition,speed,modifier)
return math.sin(tick()*addition*speed)*modifier -- lol i got this from BlackShibe's fps tutorial
end
game:GetService("RunService").RenderStepped:Connect(function(dt)
local swaySpeed,swayAmount = 0.5,0.1 -- the variables are what the names are
local movementSway = Vector3.new(getBobbing(10,speed,modifier),getBobbing(5,speed,modifier),getBobbing(5,speed,modifier))
sway:shove((movementSway / 50) * deltaTime * 10* velocity.Magnitude)
local update = sway:update(dt)
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame:Angles(0,update.Y,update.X)
end)
so things like “getBobbing” is a function inside the module? testing this out right now and integrating it with my car so i need to make sure this is correct
edit 1: also what does walkcycle mean in this context? my car doesnt use a walk cycle so i dont know what you mean by that. i also am confused with the getBobbing, do i have to make a funciton out of it? and the speed and mod, do i insert those values myself?
game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
local velocity = car.DriveSeat.RotVelocity.Y -- something so the script knows how much the car is turning
local swayAmount = 0.1
local movementSway = swayAmount * (velocity / 100) -- multipliying the amount to the velocity so more turn = more sway
sway:shove(Vector3.new(movementSway,movementSway,0))
local update = sway.update(deltaTime)
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.Angles(0, update.Y, update.Y)