I need help Animation Script

You can write your topic however you want, but you need to answer these questions:

  1. I Want to play a running animation When I start to sprint

  2. When I start to run the animation works but when I start jumping it wont stop the animation, Also when I move to much while the animation is playing it wont stop and it gets stuck again.

here is the script (btw this is on a StarterCharacterScript)

1 Like

Hello DevAqua1,

From what I’m seeing is you need to incorporate a stop for when the player jumps (presses space) to stop the animation and have a check for seeing if the player is still sprinting (holding down shift) after pressing space to jump.

local Key2 = Enum.Keycode.Space

local function SpacePressed()
     return UserInputService:IsKeyDown(Key2)
end

local function InputMid(input, gameProcessedEvent)
     if SpacePressed then
          Tween2:Play()
          PlayAnim:Stop()
          script.Parent.Humanoid.Walkspeed = 16
     end
end

Not 100% sure any of this code will work (off the top of my head) but I think you could work with this as an example to fix the issue you’re having!

Yeah it did not work for some reason but I will work on this tomorrow and try to do it again

Not sure about the jumping issue, however all I know is you’re using a deprecated way of running animations, more info on that here:

Just paste this script somewhere you do like:

Humanoid.Running:Connect(function()	
       if Humanoid.MoveDirection == Vector3.new(0,0,0) then
	       --stop your animation	
       end
end)

If you want stop the jumping too then just code “space” input pressed.