2015年1月29日 星期四

unity - rigidbody rotate

var eulerAngleVelocity : Vector3 = Vector3 (0, 100, 0);
 function FixedUpdate () {
  var deltaRotation : Quaternion = Quaternion.Euler(eulerAngleVelocity * Time.deltaTime);
  rigidbody.MoveRotation(rigidbody.rotation * deltaRotation);
 }

unity - rigidbody move

 http://docs.unity3d.com/ScriptReference/Rigidbody.MovePosition.html


private var speed : Vector3 = Vector3 (3, 0, 0);
 function FixedUpdate () {
  rigidbody.MovePosition(rigidbody.position + speed * Time.deltaTime);
 }

2015年1月27日 星期二

easy gravity example

1- drag a 3Dobject->cube into sense
2- add script on the right side, component
3- write the script





2015年1月18日 星期日