Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (holdingball)
     {
         positionOfTheBall();  //initial position of the ball
         if (Input.GetMouseButton(0))
         {
             Debug.Log("mouse clicked ball is out of your hands");
             ball.ActivatePEffect();//activate particle system
             holdingball = false;
             ball.GetComponent <Rigidbody>().useGravity = true;
             //apply force on the ball + curve
             ball.GetComponent <Rigidbody>().AddForce(playerCamera.transform.forward * ballThrowingForce);
         }
     }
 }