title: Unity AddForce to Player onTriggerEnter
body: <p><a href="https://i.stack.imgur.com/5GK70.png" rel="nofollow noreferrer">Screenshot Game</a>&quot;I'm making a game, i want to create a bounce script when the player jumps on a box and bounces
  up, this is what i have so far&quot;</p>
  <pre><code>public Rigidbody rb;
  public float bounceForce = 3f;
  
  // Start is called before the first frame update
  void Start()
  {
      rb = GetComponent&lt;Rigidbody&gt;();
      
  }
  
  void OnTriggerEnter(Collider coll) {
      if(coll.gameObject.tag == &quot;Player&quot;){
          Debug.Log(&quot;Jumpforce&quot;);
          GetComponent&lt;Rigidbody&gt;().AddForce (0,bounceForce,0);
          
      }
      
  }
  </code></pre>