Unity3d实现人物跳跃

首先给对象添加刚体和碰撞体。spa 在FixedUpdate中写入以下代码,不能是Update,由于是物理属性,必需要FixedUpdateorm GetComponent<Rigidbody>().velocity += new Vector3(0, 5, 0); //添加加速度 GetComponent<Rigidbody>().AddForce(Vector3.up * mJumpSpeed
相关文章
相关标签/搜索