Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var enemy : GameObject;
- var speed : float = 1.0;
- var isdying : boolean = false;
- var enemanim : Animator;
- function Awake(){
- isdying = false;
- enemanim = GetComponent(Animator);
- enemanim.SetFloat("enemydie",0);
- this.transform.position.x = 8.325;
- this.transform.position.y = -1.2;
- }
- function Update(){
- this.transform.Translate(Vector3(Input.GetAxis("Horizontal") * speed * Time.deltaTime, 0, 0));
- this.rigidbody2D.velocity = Vector2(-5,0);
- if (isdying==true){
- enemanim.SetFloat("enemydie",1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement