#Run animation for morph
1 messages · Page 1 of 1 (latest)
to let you know that all of the other animation work but only the run is bugged
and here is the full script if you wanna check
function onRunning(speed)
print("function")
if speed > 0.01 then
print("walking")
playAnimation("walk", 0.1, script.Parent.Humanoid)
elseif speed > 16 then
print("running")
playAnimation("run", 0.1, script.Parent.Humanoid)
pose = "Running"
end
else
print("idling")
playAnimation("idle", 0.1, script.Parent.Humanoid)
pose = "Standing"
end
end
Im stupid btw this probably wont work im sure you had a good reason why you didnt use an elseif let me know if this works - i tried looking though the rest of the script but anyways a good way to test is also adding in a heap of print statements to double check which exact part is broken
there is a problem with the "else"
remove end
ok
i tested it and the run doesnt work
and it doesnt print running
function onRunning(speed)
print("function")
if speed > 0.01 then
print("walking")
playAnimation("walk", 0.1, script.Parent.Humanoid)
elseif speed > 16 then
print("running")
playAnimation("run", 0.1, script.Parent.Humanoid)
pose = "Running"
else
print("idling")
playAnimation("idle", 0.1, script.Parent.Humanoid)
pose = "Standing"
end
end
this should work better
maybe
depends
still doesnt having the running printing
function onRunning(speed)
print("function")
if speed > 0.01 and speed < 16 then -- added this???
print("walking")
playAnimation("walk", 0.1, script.Parent.Humanoid)
pose = "Walking" -- why missing this in your original code too i added cuz it seemed right
elseif speed > 16 then
print("running")
playAnimation("run", 0.1, script.Parent.Humanoid)
pose = "Running"
else
print("idling")
playAnimation("idle", 0.1, script.Parent.Humanoid)
pose = "Standing"
end
end
im just trying to help but i've only been coding for like 6 months - so i can be pretty stupid
it only plays for 0.1 sec
hmmmm set it to longer
playAnimation("run", 5, script.Parent.Humanoid) --5 seconds might be too long
also remove this
pose = "Walking" -- why missing this in your original code too i added cuz it seemed right
i added that lol might actually break your code
it still print the run but still doesnt work
send screenshot of the code you have currently
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, script.Parent.Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, script.Parent.Humanoid)
return
--Does this have anything to do with the issue?
elseif (pose == "Running") then
playAnimation("walk", 0.1, script.Parent.Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or --...
-- print("Wha " .. pose)
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
you have the animation run here aswell
not sure if this is linked
wait where do i put it?
** You are now Level 2! **
im not sure ive never coded animations like this but i assume what you're trying to do is
when the player runs
Humanoid.Running:connect(onRunning)
it runs the code
function onRunning(speed)
print("function")
if speed > 0.01 and speed < 16 then
print("walking")
playAnimation("walk", 0.1, script.Parent.Humanoid)
elseif speed > 16 then
print("running")
playAnimation("run", 0.1, script.Parent.Humanoid)
pose = "Running" --This here
else
print("idling")
playAnimation("idle", 0.1, script.Parent.Humanoid)
pose = "Standing"
end
end
but also when this runs
while Figure.Parent~=nil do
local _, time = wait(0.1)
move(time)
end
it also runs
elseif (pose == "Running") then
playAnimation("walk", 0.1, script.Parent.Humanoid)
yay
small problem
if i stop running while moving it will continue the run animation until i stop
no joke i spent 4 hours looking over the same code and asked someone in here just for it to be spotted within 10 seconds by some random and it was exactly like this like some tiny error i missaw
I ALSO MANAGE TO FIX THIS PROBLEM
yay heck yeah dude
i just had to remove that line
that code line was the imposter
now i will lurk for a crawl animation
i mean a crawl script
good luck with your game dude im happy i could help even a little bit. im still waiting for someone to help with my code issue