Rotates the rigidbody to rotation
.
var eulerAngleVelocity : Vector3 = Vector3 (0, 100, 0); function FixedUpdate () { var deltaRotation : Quaternion = Quaternion.Euler(eulerAngleVelocity * Time.deltaTime); rigidbody.MoveRotation(rigidbody.rotation * deltaRotation); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public Vector3 eulerAngleVelocity = new Vector3(0, 100, 0); void FixedUpdate() { Quaternion deltaRotation = Quaternion.Euler(eulerAngleVelocity * Time.deltaTime); rigidbody.MoveRotation(rigidbody.rotation * deltaRotation); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): public eulerAngleVelocity as Vector3 = Vector3(0, 100, 0) def FixedUpdate() as void: deltaRotation as Quaternion = Quaternion.Euler((eulerAngleVelocity * Time.deltaTime)) rigidbody.MoveRotation((rigidbody.rotation * deltaRotation))