- 最后登录
- 2019-12-25
- 注册时间
- 2012-8-24
- 阅读权限
- 90
- 积分
- 71088
- 纳金币
- 52336
- 精华
- 343
|
public var walkingSpeed : float = 5.0;
public var walkingSnappyness : float = 50;
public var turningSmoothing : float = 0.3;
function FixedUpdate () {
// Handle the movement of the character
var targetVelocity : Vector3 = movementDirection * walkingSpeed;
var deltaVelocity : Vector3 = targetVelocity - rigidbody.velocity;
if (rigidbody.useGravity)
deltaVelocity.y = 0;
rigidbody.AddForce (deltaVelocity * walkingSnappyness, ForceMode.Acceleration);
为什么他给椭圆的刚体加力,他会平移而不会倒下去呢??? |
|