Essentially I just worked with the velocity of the characters humanoid root part and then used tween service with a weld to make it move up and down depending on which direction the velocity is going. It was not really the most ideal solution to my problem so I scrapped it but it worked out alright for the effort I had put in. These are pretty much the main functions I used:
Code
local Tweens = {}
function CancelAllTweens()
for i,v in pairs(Tweens) do
table.remove(Tweens, i)
v:Cancel()
v:Destroy()
end
return
end
game:GetService("RunService").Stepped:Connect(function()
if game.Players.BruceWayne5222.Character.Torso.Velocity.X < 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Y < 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Z < 0 then
local Tween01 = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.1), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45 - 15))})
CancelAllTweens()
table.insert(Tweens, Tween01)
Tween01:Play()
elseif game.Players.BruceWayne5222.Character.Torso.Velocity.X > 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Y > 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Z > 0 then
local Tween02 = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.1), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45 + 15))})
CancelAllTweens()
table.insert(Tweens, Tween02)
Tween02:Play()
else
local Tween = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.2, Enum.EasingStyle.Sine), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45))})
CancelAllTweens()
table.insert(Tweens, Tween)
Tween:Play()
end
end)
Thanks, i appreciate your help, some of guy said that he used ‘Spring Module’, i have no clue how it works like. But if you want, you could read about spring module and check it out! I will try your code, thanks.