What I want to happen is that whenever the player stops moving, the crawling animation stops immediately. However, due to the way I wrote my code, the full animation will play anyways, even if you tap WASD for less than a second.
I know why this is, it's because the way I wrote this script makes the full animation play before checking to see if it needs to be stopped, but how do I fix this? Cause honestly, I have no idea. I'm rather new to scripting, so please be patient with me.
#Crawling animation keeps playing despite not moving
1 messages · Page 1 of 1 (latest)
ez
i'm not sure what UIS.InputBegan and UIS.InputEnded is supposed to be, but maybe you could look that up in the docs and tell us? i don't know where to look but i found this on google maybe you can explain what it is and how it works? https://create.roblox.com/docs/reference/engine/classes/UserInputService#InputBegan
I-
I don't know why I didn't think to do this sooner 😭
I feel really dumb but thanks for saying that to make things click together in my head LMAO
Put them into a nested if
Oh wait now there's a new bug I think 💀
If I enter and exit crawl mode, pressing any movement keys at all makes the crawl animation play
but I think I can fix that
It also doesn't play if I hold more than 1 movement key
** You are now Level 4! **
now I remember why I didn't do this before
your indention is off in a lot of places so the code is harder to read, e.g you do if crawlcheck== true then uis.inputbegan:() ... end end uis.inputended:() end but the way you indented your code makes it look like you connect uis.inputended in the same code block as you do connecting uis.inputbegan and then one has to ponder, what's going on with your indentation? 
idk bro I keep trying to fix the indentation but Roblox Studio does its own thing
on top of well this
there was a double indent there i couldn't find it before you deleted :p
coz if() not on same indent as its' end.
I know
there's a third end that looks like it's doing nothing
but if I get rid of it, it marks all the code after it as wrong
idk why that is
yeah you got a bunch of those problems
indentation doesn't matter to lua, it does to python, but really this is just making it easier to write your own code
roblox studio auto-indents for a reason. it's very useful. why not use it? 🤷
practice, learn how it works. i belief in you 
cause sometimes it auto-indents in a way that makes my code harder to read 💀
so roll with your own indent style, just bear in mind the expected normals. don't do: lua if a then if b then print("hi") end end
Oh that shi is hurting my eyes