Ejemplo 1: cuaternión de unity3d agregar 90 grados
//This way you can add a specific of degree (in this case 90 on y)
//to a specific axis
rotation *= Quaternion.Euler(0, 90, 0);
Ejemplo 2: transform.rotation – 90 unit
var lookPos = target.position - transform.position; lookPos.y = 0; var rotation = Quaternion.LookRotation(lookPos); rotation *= Quaternion.Euler(0, 90, 0); // this adds a 90 degrees Y rotation var adjustRotation = transform.rotation.y + rotationAdjust; //<- this is wrong! transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
¡Haz clic para puntuar esta entrada!
(Votos: 1 Promedio: 5)