예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (holdingBall)
     {
         Ball.GetComponent <Rigidbody>().useGravity = false;
         Ball.transform.position = PlayerCamera.transform.position + PlayerCamera.transform.forward * BallDistance;
         if (Input.GetKeyDown(KeyCode.Space))
         {
             Ball.ActivateTrail();
             Ball.GetComponent <Rigidbody>().useGravity = true;
             holdingBall = false;
             Ball.GetComponent <Rigidbody>().AddForce(PlayerCamera.transform.forward * ThrowingForce);
         }
     }
 }