I've been trying find this out for hours. Does anyone know how to bind the shift key in order to sprint and do a running animation? Any response that will help with the situation would be appreciated. :D
You can bind keys by connecting to the UserInputService.InputBegan
event. For the shift key, check if the KeyCode
field of the passed InputObject
is equal to Enum.KeyCode.LeftShift
(or Enum.KeyCode.RightShift
).
Sprint by adjusting the WalkSpeed
of the player character's Humanoid
. The default speed is 16 (studs/second).
You can play an animation on a player by loading one onto the player's Humanoid
with :LoadAnimation()
and playing the track that is returned with the :Play()
method.
This information is all available on the Official ROBLOX Wiki either as API pages (lists of properties, functions, and events for a given Instance
) or as tutorials - I've hyperlinked to some in this answer. The more descriptive you are with a question (what you have looked at, what you have tried so far), the easier it is for us to help.