I want to make a zombie walk. Little force forward wait a little and then again a bit force forward. Here my code:
var intervalWalkTime:float = 3;
var walkSpeed:float = 10;
function Start () {
animZombie = GetComponent(Animator);
InvokeRepeating("dragWalk", 1, intervalWalkTime);
}
function dragWalk(){
rigidbody2D.AddForce(new Vector2(walkSpeed,0));
}
I put the script on my rigidBody2D gameObject.. but nothing.
↧