Game running at different speeds on different quality levels.

So I got a strange problem. My game is running at different speeds on different quality levels. It does this even though I’m using the AddForce functions of unitys Physics engine to move my characters. Here’s the code I use for one type of enemy:

			direction = player.transform.position - transform.position;

			angle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg;

			transform.rotation = Quaternion.Euler(new Vector3(0,angle, 0));

			rigidbody.AddForce(direction);

			if (Mathf.Abs(rigidbody.velocity.x) > velocityCap)
			{
				rigidbody.velocity = new Vector3(velocityCap * Mathf.Sign(rigidbody.velocity.x), 0, rigidbody.velocity.z);
			}
			if (Mathf.Abs(rigidbody.velocity.z) > velocityCap)
			{
				rigidbody.velocity = new Vector3(rigidbody.velocity.x, 0, velocityCap * Mathf.Sign(rigidbody.velocity.z));
			}

I can’t find the source of this problem. Does it have to do with my velocity capping? I would appreciate all help I can get. Thanks!

As previous have mentioned.

Use

FixedUpdate

and

rigidbody.AddForce(direction * Time.fixedDeltaTime);