Since you're making this a jump animation, check the Y velocity to ensure that it works at the right moment, you could also do this with the Jump state on the Humanoid but I usually use velocity on a LocalScript because it's more precise.
Keep in mind, I made this script while not on studio so I might've made a mistake but this should be enough information to tell you how to do it.
local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid") or Character:WaitForChild("Humanoid")
local RootPart = Humanoid.RootPart
local Animation = Instance.new("Animation")
Animation.AnimationId = string.format("rbxassetid://%s", 0)
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack.AnimationPriority = Enum.AnimationPriority.Core
AnimationTrack.Looped = false
game:GetService("RunService").Stepped:Connect(function()
if RootPart.Velocity.Y > 28 then
if AnimationTrack.IsPlaying == false then
AnimationTrack:Play()
end
else
AnimationTrack:Stop()
end
end)
4 comments
One question: is it your animation LIKE you uploaded it to roblox.
yes it is
Make sure the animation is in r50 and you game is in the same. There might be a animation script that doesnt have a animation id in the script.
what is r50?