Adds a torque to the rigidbody.
torque
axis.// Spins the rigidbody around the global y-axis function FixedUpdate () { rigidbody.AddTorque (Vector3.up * 10); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void FixedUpdate() { rigidbody.AddTorque(Vector3.up * 10); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def FixedUpdate() as void: rigidbody.AddTorque((Vector3.up * 10))
Adds a torque to the rigidbody.
torque
axis.// Spins the rigidbody around the global y-axis function FixedUpdate () { rigidbody.AddTorque (0, 10, 0); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void FixedUpdate() { rigidbody.AddTorque(0, 10, 0); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def FixedUpdate() as void: rigidbody.AddTorque(0, 10, 0)