title: Player not moving down with gravity after transforming position - UNITY 2D
body: <p>I'm making a game in which I have to transform the players position after he completes the objective, but when I transform him, he's stuck in the air on the new transform position, even though I have a Rigibody2D set on it with a gravity scale of 2. When I move him manually by dragging and releasing, he falls to the ground normally. I'm fairly new so any help would be appreciated. I can't seem to identify the problem.
  Here's the code,</p>
  
  <pre><code>    public GameObject player;
      public Transform nextPart;
      public Camera cam;
  
  
      void Start()
      {
  
      }
  
      // Update is called once per frame
      void Update()
      {
          if (PlayerController.canTransform)
          {
              player.transform.position = nextPart.position;
              cam.transform.position = new Vector3(nextPart.position.x, nextPart.position.y, -10);
          }
  
      }
  </code></pre>
  
  <p>Here's a picture too,</p>
  
  <p><a href="https://i.stack.imgur.com/eGwaQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eGwaQ.png" alt="enter image description here"></a></p>