Hi, my name is bullet!, today i’ve ran into another issue. I was working on revamping my game’s sprint code and i ran into a problem, when trying to get the jump animation to work.
So, no errors happen, it prints play [ read the script for context ], but all the player does is jump up in the air with the run animation still playing, but the jump animation not.
here’s the script/code snippet of the jump:
if input.KeyCode == Enum.KeyCode.Space and Running == true and Stamina.Value >= 2 then
if Character.Dancing.Value == false then
if Character.ComicallyLarge.Value == false then
if not (JumpAnim) then
JumpAnim = Animator:LoadAnimation(Anim2)
end
RunAnim:Stop()
task.wait()
JumpAnim:Play()
print("play")
task.wait()
Stamina.Value -= 2
task.wait()
script.Parent:TweenSize(UDim2.new(Stamina.Value/ 100, 0, 1, 0), "Out", "Linear",0)
script.Parent.Parent.StaminaStatus.Text = Stamina.Value.."/".."100"
end
end
end
so, what do you think it could be? thanks for reading, and please help if you can!
2 Likes
Hey bullet!
Make sure you provide a little bit more of code so fellow scripters can further understand what you’re talking about.
Onto the support;
- Does the stamina actually drain?
- Does the run animation repeatedly play? (in a loop or an event)
- Are you sure the animation’s Priority is above the run animation’s Priority?
- Are you sure the animation id’s for ‘JumpAnim’ or ‘Anim2’ belong to you or a group?
Since the condition statements are true and they run the specified code as you said, these are the only things I can come up with. Make sure to reply if you’ve checked these and it still doesn’t work.
3 Likes
The stamina does drain, the run animation is a loop, the jump animation priority is core and is a loop, the run is movement, and the ids belong to the group of the game.
after changing the jump animation priority to core [ it was on movement aka same as run before ] it did work, but it still doesn’t loop even though the animation is a loop
Here is a list of all animation priority Enums
Core is the lowest priority for animations, which means pretty much any animation with higher priority can play over it. I recommend to set your Jump animation priority to Action.
If you’re 100% sure that the animation is looped in the editor, you can always try making it looped in the script itself. I suppose that Looped only works when setting it before you play the track. Here’s an example below:
JumpAnim.Looped = true
Let me know if this helped! 
1 Like
im 8% sure its the Stamina.Value -= 2 i think its just = but i wouldnt trust me i have no idea what im doing
dang, roblox makes it seem like core is the highest priority since it’s at the top of the animation priority list, thanks for the solution!
1 Like