Erratic behaviour during rotation

After a one-week battle of reading the other topics on the forum and numerous tries to alter my code I need your help with defining a proper rotation logic. My problem is that, at a certain angle, the objects forget that they should rotate and stop in place until the player moves near them at a specific angle, as can be seen in the video.
http://www.megafileupload.com/en/file/556113/Rotation-Flip-wmv.html

I know the answer is probably painfully obvious, but I just can’t understand how to do it and I’m just too short a unityscript coder to grasp the Quaternion and eulerAngles, so if you could at least pinpoint in which direction I should go to understand this. I don’t want to copy others script because it will put me nowhere in the long run.

Here is the code which I am currently trying to work:


var rotation = Quaternion.LookRotation(astTarget.position - astSelf.position);
astSelf.rotation = Quaternion.Slerp (astSelf.rotation, rotation, astSmoTur * Time.deltaTime);
astSelf.rotation.y = 0;
astSelf.rotation.x = 0;

And here is the additional code attached to the object:


function Update() 	
var newSpeed = asteroidSpeed * Time.deltaTime; 
transform.position = Vector3.MoveTowards (transform.position, asteroidTarget.position, newSpeed);	
transform.Translate (Vector3.right * newSpeed); 

This bit:

astSelf.rotation.y = 0;
astSelf.rotation.x = 0;

Most designers are used to working with “Euler angles”, which is what you’ll see in the inspector, but Unity’s internals use quaternions to represent rotation. They’re quite a bit more complicated, but do have some advantages I won’t go into. You almost never want to edit a quaternion manually.

From the manual:

They are based on complex numbers and are not easy to understand intuitively. You almost never access or modify individual Quaternion components (x,y,z,w)

You can convert back and forth easily, though:

var euler = astSelf.eulerAngles;
euler.x = 0;
euler.y = 0;
astSelf = Quaternion.Euler(euler);