Code format sent
local playing, completed = Enum.PlaybackState.Playing, Enum.PlaybackState.Completed
local style, dir = Enum.EasingStyle.Sine, Enum.EasingDirection.InOut
local sin = script:WaitForChild(“Sine”) --remember, the NumberValue; it will act as the “time” for our curve
local isSprinting = char.Sprint:WaitForChild(“IsSprinting”) --aah, finally it came in use
local dur, durSprint = 0.675, 0.5 --tween duration while walking & sprint time, respectively
–the tweens for walking and sprinting (I made them reverse, but running only once)
local ti, tiSprint = TweenInfo.new(dur, style, dir, 0, true), TweenInfo.new(durSprint, style, dir, 0, true)
local oneTween, oneSprintTween = ts:Create(sin, ti, {Value = 1}), ts:Create(sin, tiSprint, {Value = 1})
–offset = camera offset; maxRandomBounds = for clamping the Perlin Noise value for point0
local offset, maxRandomBounds = 0.25, 0.5
–point0 and point2 are on the right and left side, respectively
local point0, point2 = Vector3.new(offset, 0, 0), Vector3.new(-offset, 0, 0)
–remember, point1 is in the middle; we’ll be using Perlin Noise for the X position
local point1 = Vector3.new(0, -offset, 0)
local ti2 = TweenInfo.new(dur / 2, style, dir)
–tween back to the origin
local tweenBack = ts:Create(hum, ti2, {CameraOffset = Vector3.new(0, 0, 0)})
–tween to point0 so it can bob back and forth
local begTween = ts:Create(hum, ti2, {CameraOffset = point0}) --no, I’m not making the tween beg!
–this will be for our Perlin Noise, the higher the inc, the more random
local counter, counterInc = 1, 0.1
–this will be true once begTween starts playing (to make it not play again)
local running = false
This text will be hidden
When trying to show code on the devloper forum, please use code blocks. If you don’t know how to do code blocks there is a tutorial here
Basically when replying just click the symbol up the top, (</>) and it should work.