Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1642
Rep : 0
Join date : 2014-02-07
View user profile

Animations

on Tue Feb 11, 2014 11:56 am
I am following your steps on tutorial #3 for making an FPS game, and the animation won't work properly. It keeps saying :

MissingComponentException: There is no 'Animation' attached to the "M4A3" game object, but a script is trying to access it.
You probably need to add a Animation to the game object "M4A3". Or your script needs to check if the component is attached before using it.
walkingscript.Update () (at Assets/Guns/Gun Scripts/walkingscript.js:6)
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 14
Points : 1643
Rep : 0
Join date : 2014-02-08
Age : 20
View user profile

Re: Animations

on Tue Feb 11, 2014 4:08 pm
I had a similar problem. I just restarted my project from the start.
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1642
Rep : 0
Join date : 2014-02-07
View user profile

Re: Animations

on Tue Feb 11, 2014 4:27 pm
Did it work TheReddestDawn?
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 14
Points : 1643
Rep : 0
Join date : 2014-02-08
Age : 20
View user profile

Re: Animations

on Tue Feb 11, 2014 5:03 pm
Was just working on it and sadly no. I have the same error you have, and when I try to play the game what occurs is that the animation is constantly playing on a loop, no matter whether you are pressing W or if you're pressing nothing. I've tried taking the animation from my assets and putting it into the Gun (I parented my hands to my gun, so that's where the animation is) For some reason it still doesn't work  Sad 
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1642
Rep : 0
Join date : 2014-02-07
View user profile

Re: Animations

on Tue Feb 11, 2014 5:14 pm
Maybe we should ask MisterNinjaBoy
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 14
Points : 1643
Rep : 0
Join date : 2014-02-08
Age : 20
View user profile

Re: Animations

on Tue Feb 11, 2014 5:45 pm
Hopefully they will see our post, alas for now we can just post spiderman memes.
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1642
Rep : 0
Join date : 2014-02-07
View user profile

Re: Animations

on Tue Feb 11, 2014 5:50 pm
Lol  lol! 
avatar
Admin
Admin
Posts : 608
Points : 3170
Rep : 406
Join date : 2013-12-11
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: Animations

on Tue Feb 11, 2014 10:27 pm
The only way you are getting this error, is as stated by the error; You don't have the animation component attached to the model you added the script to. Make sure you do the parenting correctly (Gun and hands parented to each other) and then attached to main camera, then make sure the gun and hands (whichever the parent is) has animations, (and the animationcomponent) Then the script should be able to access the defined animation accordingly. (if you correctly named which anim to play in the script.)
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1642
Rep : 0
Join date : 2014-02-07
View user profile

Re: Animations

on Wed Feb 12, 2014 10:05 am
I got this error:

The animation state walking could not be played because it couldn't be found!
Please attach an animation clip with the name 'walking' or call this function only for existing animations.
UnityEngine.Animation:Play(String, PlayMode)
walkingscript:Update() (at Assets/Guns/Gun Scripts/Walking/walkingscript.js:6)

Please help MisterNinjaBoy
Back to top
Permissions in this forum:
You cannot reply to topics in this forum