title: Unity 2D Colliders Stuck to Walls?
body: <p>I have just updated Unity to version 5.2.1 from 5.0.0 this morning and I experienced a few problems. After Unity translated the game to work for the new version, I tested the game. Everything worked fine, except that when I shot a bullet in my game, they would stick to the walls instead of bouncing off of them, but only at certain angles and distances. It was like the bullet was so fast that it skipped hitting the collider and got stuck inside of the collider. That would make a little bit of sense, but the weird part is that I have a C# script for slow motion in the game. Whenever I turn the slow motion on and then turn it off again, the problem with bullets sticking goes away. I cannot seem to figure out what is causing the problem and it definitely wasn't there before I updated the software. Can anyone help me out with this? Thanks. I'll post the bullet script and the slow motion script below. The bullet is instantiated inside the player script by the way.</p>
  
  <p>Bullet Script:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class Bullet : MonoBehaviour {
  
  public float bulletSpeed;
  public float bulletOpacity;
  public bool fadeOut;
  
  Animator anim;
  Rigidbody2D rigidbod;
  SpriteRenderer spriterend;
  
  public GameObject player;
  public float aimRotation;
  
  // Use this for initialization
  void Start () {
  
      anim = GetComponent&lt;Animator&gt; ();
      rigidbod = GetComponent&lt;Rigidbody2D&gt; ();
      spriterend = GetComponent&lt;SpriteRenderer&gt; ();
  
      rigidbod.velocity = transform.right * bulletSpeed;
      rigidbod.gravityScale = 0;
  
      bulletOpacity = 1;
  
  }
  
  // Update is called once per frame
  void Update () {
  
      Destroy (gameObject, 3f);
  
      spriterend.color = new Color (1f, 1f, 1f, bulletOpacity);
  
      if (fadeOut == true)
          bulletOpacity -= 0.03f;
  
      if (bulletOpacity &lt;= 0)
          Destroy (gameObject);
  
      aimRotation = player.GetComponent&lt;Player&gt; ().aimRotation;
  
  }
  
  void OnTriggerEnter2D (Collider2D bulletHit) {
  
      /*if (bulletHit.gameObject.layer == LayerMask.NameToLayer ("vulnerableLayer")) {
  
      }*/
      rigidbod.gravityScale = 1;
      rigidbod.drag = 1;
      fadeOut = true;
  
  }
  
  }
  </code></pre>
  
  <p>Slow Motion Script:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class SlowMotion : MonoBehaviour {
  
  public float currentLongevity = 0f;
  public float slowAmount = 0.2f;
  public float normalTime = 1f;
  public float slowLongevity = 0.4f;
  
  
  // Use this for initialization
  void Start () {
  
  }
  
  // Update is called once per frame
  void Update () {
  
      if (Input.GetMouseButtonDown (1)) {
          Time.fixedDeltaTime = 0.0f * Time.timeScale;
          if (Time.timeScale == normalTime)
              Time.timeScale = slowAmount;
      }
  
      if (Time.timeScale == slowAmount) {
          currentLongevity += Time.deltaTime;
      }
  
      if (currentLongevity &gt; slowLongevity) {
          currentLongevity = 0;
          Time.timeScale = normalTime;
      }
  
  }
  }
  </code></pre>