首页 > 让小球跳起来

让小球跳起来

// If on the ground and jump is pressed...

if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)

{

// ... add force in upwards.

m_Rigidbody.AddForce(Vector3.up*m_JumpPower, ForceMode.Impulse);

}

转载于:https://www.cnblogs.com/jiahuafu/p/7079115.html

更多相关: