Alright, I fixed the problem with the animation, and I tried your script, but the animation keeps repeating for some reason, I only have one script for the walking, and I changed it to yours, so I don’t know why it’s repeating.
Ok, so I made it so that the new
thingy is printed everytime the state changes and, this is what came out.
It seems like the running state starts whenever I am on a surface, and not Idle, for some reason.
Does anybody know why this could be happening?
Enum.HumanoidStateType.Running does not necessarily mean you are ‘running’ it also means you are idle, or walking. It is pretty much the state you are in when on a surface.
Would I put if script.Parent.Humanoid.WalkSpeed > 0.01 then
after it checks if its in a Running state then?
or you can check humanoid.movedirection
if not script.Parent.Humanoid.MoveDirection == Vector3.new(0,0,0) then
Like this?
script.Parent.Humanoid.MoveDirection.Magnitude > 0 then
For some reason this only works when I jump and then walk. Also it still does it when im idle.
can you show what your code currently looks like?
also, are all the animaions at least playing, its just they are not playing in the correct way?
Hey. If you fixed the problem with the animation, then maybe you don’t need to use my Script
anymore? What did you mean exactly by that?
Anyways, it still would be good to see your current code [same request as SelDraken]
Had school sorry, I’ll send screenshots in a bit.
local anim = game.ReplicatedStorage.Animations.Walk
local walk = script.Parent.Humanoid.Animator:LoadAnimation(anim)
script.Parent.Humanoid.StateChanged:Connect(function(_, new)
print(new)
if new == Enum.HumanoidStateType.Running then
if script.Parent.Humanoid.MoveDirection.Magnitude > 0 then
walk:Play()
end
else
walk:Stop()
-- Ideally you'd play your idle animation here (not necessary)
end
end)
Try commenting out walk:Stop()
. I replied late because I didn’t see this update, but next time @ me.
We’ll resolve this in PMs since this question is getting crowded with our one-to-one posts.
How I solved it was by replacing the walking animation in the Animate script itself. To do that you’ll have to clone the original and put it in StarterCharacterScripts (and make sure the name is still “Animate”).
It’s a custom startercharacter, though.
In that case just put the modified Animate script inside the custom character model
I changed p the Animate script a little, and it works. THank you.