use quaternions in unity to rotate object.

Hi, i use a mpu6050 with raspberry pi and unity 3d to rotate an object but i want to use quaternions because it haven’t gimbal lock, i use this with angles, but isn’t precise

	var vec = transform.eulerAngles;
	vec.x = parseFloat(res[0]);
	vec.y = parseFloat(res[1]);
	vec.z = parseFloat(res[2]);
	this.transform.eulerAngles = vec;

but i want to use quaternions, anyone know how to do it? Thanks

From Vector3 to Quaternion: Unity - Scripting API: Quaternion.Euler

Transform.rotation is already a quaternion so you can directly make it equal to any quaternion.