title: Unity2D collisions and some physics
body: <p>I'm making a 2D Tank shooter game, but I got some problems and questions:</p>
  
  <ol>
  <li>I got some problems with collisions.</li>
  </ol>
  
  <p><a href="https://drive.google.com/folderview?id=0BxbWZRJWH3lqfmNhMjExOHY0RFY0SEo3REhlaVIwZHRtSFlaQnZtc25XV0Z1MldVSDhuQjg&amp;usp=sharing" rel="nofollow">GIF of a problem here. Go to tank collision problem.</a> (I can't post more than 2 links because of low reputation, so You will have to go to images manualy, sorry.)</p>
  
  <p>I need to make my tank do not do like shown above. I'm using rigidbody on empty parent and box collider on tank body.</p>
  
  <p>My "Tank (root)" in inspector  and "tankBody" (hull) in inspector is <a href="https://drive.google.com/folderview?id=0BxbWZRJWH3lqflhNWlZzMExzbm1WYmxRb2NZaWdZSjNoS1hHOGZpb3RsQkFqWjFNcEZkWmM&amp;usp=sharing" rel="nofollow">here.</a></p>
  
  <p>tank movement code:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class Movement : MonoBehaviour {
      public float thrust;
      public float rotatingspeed;
      public Rigidbody rb;
  
  void Start () {
      rb = GetComponent&lt;Rigidbody&gt;();
  }
  
  void Update () {
      if (Input.GetKey (KeyCode.W)) {
          transform.Translate (Vector2.right * thrust);           
      }
      if (Input.GetKey (KeyCode.S)) {
          transform.Translate (Vector2.right * -thrust);
      }
      if(Input.GetKey(KeyCode.A)) {
          transform.Rotate(Vector3.forward, rotatingspeed);
      }
      if(Input.GetKey(KeyCode.D)) {
          transform.Rotate(Vector3.forward, -rotatingspeed);
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <ol start="2">
  <li><p>My bullets fly like they are in zero gravity/space. I need them to do not hover like that(I got similar problem before and I couldn't fixed it..). There is gif in first link in 1.st problem.
  shooting code:</p>
  
  <p>using UnityEngine;</p>
  
  <p>using System.Collections;</p>
  
  <p>public class Shooting : MonoBehaviour {</p>
  
  <pre><code>    public Rigidbody2D projectile;
      public float speed = 20;
      public Transform barrelend;
  
  void Update () {
      if (Input.GetButtonDown("Fire1"))
      {
          Rigidbody2D rocketInstance;
          rocketInstance = Instantiate(projectile, barrelend.position, barrelend.rotation) as Rigidbody2D;
          rocketInstance.AddForce(barrelend.right * speed);
      }
  }
  </code></pre>
  
  <p>}</p></li>
  </ol>