#IDLE ANIMATION NOT WORKING
1 messages · Page 1 of 1 (latest)
local animator = script.Parent:WaitForChild("Humanoid"):WaitForChild( "Animator")
local attackanim = script:WaitForChild("attackanim")
local attackanimTrack = animator:LoadAnimation(script:WaitForChild("attackanim"))
local runanimTrack = animator:LoadAnimation(script:WaitForChild("runanim"))
local idleanimTrack = animator:LoadAnimation(script:WaitForChild("idleanim"))
local range = script.Parent:WaitForChild("range")
local zomhum = script.Parent:WaitForChild("Humanoid")
if zomhum.WalkSpeed > 0 then
if idleanimTrack.IsPlaying then idleanimTrack:Stop() end
runanimTrack.Looped = true
runanimTrack:Play()
runanimTrack:AdjustSpeed(4)
elseif zomhum.WalkSpeed == 0 then
if runanimTrack.IsPlaying then runanimTrack:Stop() end
idleanimTrack.Looped = true
idleanimTrack:Play()
end
did you set its walkspeed to 0
WalkSpeed is constant, it doesnt change to 0 even if its not moving
so how do i know when a bot stopped moving
probably by checking the primaryparts Velocity.Magnitude
I’m not talking about the walkSpeed property in the humanoid, I want my code to detect the exact speed the player is going at (so it returns 0 if they aren’t walking, 16 if they walk and something like 50 for example if the player is on a platform that’s sliding on a ramp). As I said in the title, I will also need to detect if the player ...
humanoid.MoveDirection
yea thats probably easier
MoveDirectionholds a number value am i right?
so how do i know if something stopped
compare the magnitude
so i use it like
if humanoid.WalkSpeed > insert magnitude here then
execute this script
im not familiar with MoveDirection..
movedirection is a property of humanoid and holds a vector3 value, magnitude is the length of the vector3.
** You are now Level 11! **
are there any posts/videos about this i think i needa learn abt it
search it
** You are now Level 4! **
okay ty