Why does this simple follow script make my game lag?

It makes my game lag when I apply it to an object. All it’s supposed to do is follow my character without modifying the y position so it always stays on the ground. If it collides with my character then my character loses 1 hitpoint. Here’s a screen shot of the settings for the rigidbody and other components of the enemy that I applied this script to. http://i.imgur.com/yDpFhAG.png?1 The little crab like things are what the enemy looks like.

It looks like it I remove transform.LookAt(Player.transform.position); it stops lagging. Does anyone know why?

NEW FINDING Changing collision detection to discrete also makes the problem go away, even in the presence of transform.LookAt.

public float Speed;

    void Start () {
       Player = GameObject.FindWithTag("Player");
       transform.LookAt(Player.transform.position);
    }
 
    void FixedUpdate()
    {
         SeekTarget();
    }

    void SeekTarget()

    {
       Vector3 MoveTowardsPosition = Vector3.MoveTowards(transform.position,Player.transform.position, Speed * Time.deltaTime);
       MoveTowardsPosition.y = transform.position.y;
       rigidbody.MovePosition(MoveTowardsPosition);

       transform.LookAt(Player.transform.position);
    }

Changing the collision detection from continuous dynamic to discrete worked. Alternatively not rotating the object also made the problem go away. Explanation by @Dracorat as to the why of the problem:

“Continuous dynamic attempts to alter a RigidBody’s position if it’s intersecting with another. Since the usual alter direction would be invalid, it is struggling with it. It’s also a very expensive algorithm. You’d use it only if you believe an object is moving so fast that it might pass completely through something in between frames.”

Hmmm, not sure why it lags. I played around with a simple ‘follow-player’ script. It never turned out into anything useable but I simply med use of the Vector3.Lerp command. Check into that, maybe it can help you out. Best of luck!