This is a support category for asking questions about how to get something done on the Roblox websites or how to do something on Roblox applications such as Roblox Studio.
You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make a running system that uses the running animation instead of walking animation -
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 put an Animate script with my animations inside the StarterCharacterScripts and I made this LocalScript also inside StarterCharacterScripts:
-- Services --
local contextActionService = game:GetService("ContextActionService")
local runService = game:GetService("RunService")
local players = game:GetService("Players")
-- Instances --
local player = players.LocalPlayer
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
local animator: Animator = humanoid:WaitForChild("Animator")
local runAnimationTrack = animator:LoadAnimation(script.RunAnim)
runAnimationTrack.Looped = true
runAnimationTrack.Priority = Enum.AnimationPriority.Movement
-- Constants --
local RUN_ACTION_NAME = "Run"
-- Variables --
local isRunning = false
local function RunHandler(ActionName: string, InputState: Enum.UserInputState)
if ActionName ~= RUN_ACTION_NAME or InputState ~= Enum.UserInputState.Begin then
return
end
isRunning = not isRunning
if isRunning then
humanoid.WalkSpeed = 32
runAnimationTrack:Play()
else
humanoid.WalkSpeed = 16
runAnimationTrack:Stop()
end
end
contextActionService:BindAction(RUN_ACTION_NAME, RunHandler, false, Enum.KeyCode.LeftControl)
But it overrides the idle and jump animations. I just want like, instead of using the walk animation, it uses the run Animation. Is that possible?
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!