# how can we rotate an object 360 degree using Quaternion.euler

Iam working in unity to develop a tangram game. i want to rotate an object 360degree. but its not working. i used the following code. please help me. Thanks in advance

``````void Update ()
{
if (NyARWebCam == null) {
return;
}
NyARWebCam.update ();
NyARMarker.update (NyARWebCam);
bool checkMarker = NyARMarker.isExistMarker (mId);
bool checkMarker2 = NyARMarker.isExistMarker (mId2);
string s = "", pos = "", p = "";
float firstMarker = 0f, secondMarker = 0f;
if (checkMarker) {

NyARMarker.getMarkerTransform (mId, ref markerPosition1, ref markerRotation);

if (count1 == 0) {
float temp = (markerPosition1.z + actualZ);
applyZ1 = (markerPosition1.z - temp) + 50;
newZ1 = temp;
count1++;
} else {
applyZ1 = (markerPosition1.z - newZ1) + 50;
}
applyX1 = markerPosition1.x/2;
b.transform.position = Vector3.Lerp (b.transform.position, new Vector3 (-applyX1, 36.98051f, 36.98051f), 0.5f * Time.deltaTime);
float n = 1.0f;

Debug.Log (n);

b.transform.rotation = Quaternion.Euler (n*(n/8), 90, 0);
pos = "" + applyZ1;
firstMarker = applyX1;
}
``````

Ignoring your code, here is how to rotate objects properly:

``````GameObject go;
float angle = 360.0f; // Degree per time unit
float time = 1.0f; // Time unit in sec
Vector3 axis = Vector3.up; // Rotation axis, here it the yaw axis

private void Update()
{
go.GetComponent<Transform>().RotateAround(Vector3.zero, axis, angle * Time.deltaTime / time);
}
``````

This makes your object rotate 360° in one second.