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.