-
What do you want to achieve? Keep it simple and clear!
I want to achieve a running animation when theLeft Shift
button is held down while moving. -
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i have looked on devforums for solutions
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local input = game:GetService("UserInputService")
local plrs = game:GetService("Players")
local localplr = plrs.LocalPlayer
local char = localplr.Character
local hum = script.Parent:FindFirstChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://18319166140"
local run = animator:LoadAnimation(anim)
input.InputBegan:Connect(function(input)
if input.Keycode == Enum.KeyCode.LeftShift and char.PrimaryPart.Velocity.Magnitude > 0 then
run:Play()
end
end)
sorry if its a bit unorganized