title: How to change Polygon Collider based on my animation in Unity3d?
body: <p>I have a small car game, and when I move up/down and left/right, the sprite becomes different. But the physicsbody remains the same. How do I adjust physicsbody? I added a screenshot of my sprite. At the moment I have Polygon physics body as on the right one.</p>
  
  <p>Here is the code that adjusts animation states:</p>
  
  <pre><code> void FixedUpdate()
   {
       if (Input.GetKey(KeyCode.W)) {
           rb2d.AddForce(Vector2.up * physicsConstant);
           animator.CrossFade("CarUpIdle", 0);
       } else if (Input.GetKey(KeyCode.S)) {
           rb2d.AddForce(-Vector2.up * physicsConstant);
           animator.CrossFade("CarDownIdle", 0);
       } else if (Input.GetKey(KeyCode.D)) {
           rb2d.AddForce(Vector2.right * physicsConstant);
           animator.CrossFade("CarRightIdle", 0);
       } else if (Input.GetKey(KeyCode.A)) {
           rb2d.AddForce(-Vector2.right * physicsConstant);
           animator.CrossFade("CarLeftIdle", 0);
       }
   }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/LTP9g.jpg" alt="enter image description here"></p>