QuestionNeed help| Annoying Error in Unity 4.0

Posts 13 of 3 · Page 1 of 1
Need help| Annoying Error in Unity 4.0
So i'm gonna make this thread short if u need more information just ask this is really annoying how can i fix it?


Here is my script code ( i just started making it and i noticed that when i press the fire1 mouse button it can't find animation
)

-------------------------------------------------------

function Update (){
if (Input.GetButtonDown("Fire1"))

animation.Play("shoot1");


}

-------------------------------------------------------------

I've attached a photo...

I see this section isn't very active hope someone can help...
Skärmklipp.JPG239 KB · 24 downloads
Please show your folder / file structure layout

ie.

C:\Unity\
C:\Unity\MyGame1\
C:\Unity\MyGame1\resources
C:\Unity\MyGame1\resources\weapons
Where is the 'shoot1' file?
Where is MyGame1.exe?

etc etc. however you have your folders made up.


How do you "add" shoot1 to the game? Via engine editor or script code? Post that too if applicable.
Quote Originally Posted by ResistanceRage View Post
So i'm gonna make this thread short if u need more information just ask this is really annoying how can i fix it?


Here is my script code ( i just started making it and i noticed that when i press the fire1 mouse button it can't find animation
)

-------------------------------------------------------

function Update (){
if (Input.GetButtonDown("Fire1"))

animation.Play("shoot1");


}

-------------------------------------------------------------

I've attached a photo...

I see this section isn't very active hope someone can help...


do it like this:

var FireAnim : GameObject;

function Update ()
{

if (Input.GetButtonDown("Fire1"))

animation.Play("shoot1");


}



-------------------------------

you have to add your anim to inspector and make sure its the same name as gameobject
Posts 13 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?