我希望我的球可以从一个位置跳到另一个位置,但之后不要移动。我无法想出如何实现。以下是我的代码:
void Update()
{
if (!thrown && ((Input.touchCount > 0
&& Input.GetTouch(0).phase == TouchPhase.Ended)
|| Input.GetMouseButtonDown(0)))
{
rb.isKinematic = false;
rb.AddForce(new Vector3(0.0f, 15.0f, 5.0f) );
thrown = true;
}
}