title: Shooting a laser in 2d unity top down game
body: <p>I am trying to make my player shoot straight from his position to the direction I want and I did it, but now I have a cinemachine camre the I wanted it to stay in the larger background area so I added to the background collider and it worked for the camera boundaries BUT - now the laser I am shooting (which is dynamic) is colliding with the background and doesn't being shot.
  I tried to make the laser bullet Kinematic but then its just instantiating and not being shot to distances.</p>
  <p>So how can I make my laser bullet on dynamic and still not colliding with the background?</p>
  <p>I tried the physics collision matrix without any success.</p>
  <p>Also here is my shooting code:</p>
  <pre><code>public Transform shootingPoint;
  public GameObject laserPrefab;
  [SerializeField] float projectileSpeed = 10f;
  
  // Update is called once per frame
  void Update()
  {
      if (CrossPlatformInputManager.GetButtonDown(&quot;Fire1&quot;))
      {
          Shoot();
      }
  }
  
  private void Shoot()
  {
      GameObject laser = Instantiate(laserPrefab, shootingPoint.position, shootingPoint.rotation);
      Rigidbody2D rb = laser.GetComponent&lt;Rigidbody2D&gt;();
      rb.AddForce(shootingPoint.up * projectileSpeed, ForceMode2D.Impulse);
  }
  </code></pre>