JavaScript taken from the web isn't working. Help
I copied some javascript to play an animation for attacking but it isn't working. Any help? Please?
function Update()
{
if (Input.GetKeyDown("0"))
{
animation.Play("Knife_Attack_1");
}
}
Do you even have the animation "$$anonymous$$nife_Attack_1"? I asume not. How should something be played what isn't there?
Their isn't but im only doing that so u cant see the real animation. think of it as a 'blank' this was taken from the web however.
So you have some sort of animation. Is it attached to the same GameObject the script is? Please dont answer your on post, if you dont write the solution. Just add a comment.
Oh, sorry. Im still kinda new to this. Thank you for telling me that and before I add it to the object it is reporting many errors. I was hoping that you had an idea of what Im doing wrong?
You're not providing nearly enough information.
I would suggest clicking the Learn link at the top and go to the tutorials. There's an Animation section that has 17 tutorials $$anonymous$$ching all about animation.
Your answer
Follow this Question
Related Questions
Basic JavaScript animation question 0 Answers
When do i use new ? 1 Answer
Idle , Move and Attack animations 0 Answers
Showing a restart screen on contact with an object and more... 1 Answer