- Home /
AI FOLLOW BUG
Hi guys,
I create a AI follow script, bots start separed but they begin to begin to join and they create a queue.
Sugestions for they stop join?
CODE:
var lookPos = target.transform.position - transform.position;
lookPos.y = 0;
var rotation = Quaternion.LookRotation(lookPos);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime*10);
moveDirection = Vector3(0, 0, 1);
moveDirection = transform.TransformDirection(moveDirection);
var nspeed = Random.Range(0.5 , 4.0);
moveDirection *= nspeed/10;
print(nspeed/10);
grav+=applyGravity*Time.deltaTime*applyGravity;
moveDirection.y -= grav;
controller.Move(moveDirection * Time.deltaTime *2);
animation.Play("run");
there is the video of the my AI FOLLOW
Answer by doublethink · Jan 17, 2013 at 10:55 PM
If the enemies have their own colliders and rigidbodies they are colliding into eachother and preventing eachothers progress to the player. This is usually the way developers intend this to happen. If you don't want the enemies to collide into eachother you could set their rigidbody components to IsKinematic and I don't think they will collide any more.
Your answer
Follow this Question
Related Questions
Make Clone AIs Stay Apart? 1 Answer
Enemy following the target with ITween 2 Answers
ai pathfinding project getting started scene problems 1 Answer
Can you help me make this code turn smoothly? 0 Answers
Debug.DrawRay Issue? 0 Answers