Hi all
I am making a horror game and i made a jumpscare animation script but for some reason that dose not work!
Here’s the script
local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local JumpScare = humanoid:LoadAnimation(animation)
wait(5)
JumpScare:Play()
you should use Animator inside the Humanoid to load animations since Humanoid:LoadAnimation is deprecated!
local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local animator = humanoidt:WaitForChild('Animator')
local JumpScare = animator:LoadAnimation(animation)
wait(5)
JumpScare:Play()
if it doesnt work and there is an error, please show us the error too!
ye i think theres smth wrong with animation itself or here theres two possibilites
Something wrong with the animation (usually animations not owned by you)
Your animation is being overriden by default animations. If that’s the case then set AnimationPriority to Action using Animation Editor or through script
or if above didnt work. Your script didn’t run, since it has no errors.
What this thing said above is true, but you should use the Animator to load your animations in the future. Using deprecated functions over working ones are not suggested as it can block your path on becoming a fine scripter one day. I can see your potential as an excellent boi of scripter, so do the best!