Quaternion.Inversestatic function Inverse (rotation : Quaternion) : QuaternionDescriptionReturns the Inverse of rotation.
JavaScripts
// Sets this transform to have the opposite rotation of the target
var target : Transform; function Update () { transform.rotation = Quaternion.Inverse(target.rotation); } using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public Transform target; void Update() { transform.rotation = Quaternion.Inverse(target.rotation); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public target as Transform def Update(): transform.rotation = Quaternion.Inverse(target.rotation) |
