So Im trying to make a system that whenever you walk it plays my own animation and you can also run, jump, all of that with my own animations.
I tried using Humanoid.Running but when the player would jump it still triggered the running function as if the speed wasnt 0. What approach should I use for that type of movement system?
Sounds like you’re only changing the animations. Maybe you could replace the animation ids found in the Animate script that gets created on spawn instead of making your own handler?
This is intended. Humanoid.Running fires whenever the player starts doing any sort of movement really, you can however check if they’re in the air with a bunch of different methods, like checking if their Humanoid.FloorMaterial is air, or checking if their state is freefall, etc…
Wouldnt changing the animations in the animate script be too tedious?
Nope, you just spawn into the game, copy the Animate localscript inside the character, paste it into StarterCharacterScripts, then you edit the animation inside the string values that are parented to the script
Ej: If you wanted to change the walking animation, you should change the animation id of the WalkAnim of walk
do I also need to delete the original one?
also doesnt it fire the run animation when you walk im kinda confused
You must use “MoveDirection” to detect whether the player is walking or not, using the “running” signal is kind of bad because it detects if you are moving, but you are not.
Do Something Like that:
--// Instances
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Humanoid.MoveDirection.Magnitude >= 0.01 then -->> you are walking
---do stuffs,if you are using like a shift to run just check it
end
end)
uis.InputBegan:Connect(function(input, chat)
if chat then return end
if input == Enum.KeyCode.W then
runCount += 1
if runCount == 1 then
oldTick = tick()
elseif runCount == 2 then
if oldTick - tick() <= 0.7 then
runAnim()
runCount = 0
else
runCount = 1
oldTick = tick()
end
end
end
end)
humanoid:GetPropertyChangedSignal(“MoveDirection”):Connect(function()
if humanoid.MoveDirection.Magnitude > 0 then
if walking == true then return end
walking = true
walkAnim()
else
walking = false
stopRun()
idleAnim()
end
end)
this is my current code but the run isnt working
No, just place it in StarterCharacterScripts. I hope you’re pasting it while you are not playing, right?