android - unity3d enemy prefab animator not initialized :S -
hello there need help animator not beingness initialised on enemy prefab should have tried dragging inspector not working @ lastly problem , game done please help me
ps enemy prefab has mechanim animation , instantiate them (im working sprites) , says initialised out of prefab in prefab wont initialise , doesnt allow enemies alter animation
here syntax:
animator has not been initialized. unityengine.animator:setfloat(string, single) enemyscript:playerhit() (at assets/enemies/enemyscript.js:17) main:oncollisionenter2d(collision2d) (at assets/scripts/main.js:138) ///this calls function below #pragma strict var enemysmall : gameobject; var speed : float = 1.0; var enemysmallanim : animator; function start () { this.transform.position.x = 8.325; this.transform.position.y = -1.2; enemysmallanim = getcomponent(animator); enemysmallanim.setfloat("isdead",0.0); } function playerhit(){ enemysmallanim.setfloat("isdead",1.0); //<line 17 } function update(){ this.transform.translate(vector3(input.getaxis("horizontal") * speed * time.deltatime, 0, 0)); this.rigidbody2d.velocity = vector2(-5,0); }
android unity3d unityscript
No comments:
Post a Comment