Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Shift Running a custom Animation???

Asked by 7 years ago

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

0
What have you already tried? Perci1 4988 — 7y

1 answer

Log in to vote
1
Answered by
duckwit 1404 Moderation Voter
7 years ago
Edited 7 years ago

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.

0
Ahhh, that's all I needed to know. Sorry for the lack of detail. laserhawk123 4 — 7y
Ad

Answer this question