# Determine if the game object has completely rotated once around its centre.

My game is 2d game and in that in the Update method I’m using the following code to rotate the ShowerArmPointer Gameobject in a circular pattern. Now the code is working fine and the game object is rotating in circular pattern. I need to know when the game object completes one complete circular turn. Because if the game object is rotated once I need to call another method. Can some one help me with this process. I’m a little weak in trignometry stuff. Please help me. Thanks in advance.

``````ShowerRotationTimer+=Time.deltaTime;
ShowerRotationAngle=ShowerRotationTimer;
ShowerArmPointer.transform.position= new Vector3 ((Mouth.transform.position.x + Mathf.Sin(ShowerRotationAngle) * 1), (Mouth.transform.position.y + Mathf.Cos(ShowerRotationAngle) * 1),1);
``````

Since you are changing the position of the gameobject in order to make it rotate around center one method is to store the starting position and then after rotating check if the object has reached its starting position means it has completed one cycle.

Something like:

``````Vector3 startPos;

void Start()
{
startPos = ShowerArmPointer.transform.position;
}

void Update()
{
ShowerRotationTimer+=Time.deltaTime;
ShowerRotationAngle=ShowerRotationTimer;
ShowerArmPointer.transform.position = new Vector3 ((Mouth.transform.position.x + Mathf.Sin(ShowerRotationAngle) * 1), (Mouth.transform.position.y + Mathf.Cos(ShowerRotationAngle) * 1),1);

if(ShowerArmPointer.transform.position == startPos)
{