让小球跳起来
// 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);
}
轉(zhuǎn)載于:https://www.cnblogs.com/jiahuafu/p/7079115.html
總結(jié)
- 上一篇: “生在松之侧”下一句是什么
- 下一篇: NodeJS入门--环境搭建 Intel