title: How can I fix "Cannot read value of type Vector2 from composite" error in Unity?
body: <p>I'm making a 2D game with Unity using the new Input System. I used <code>spriteRenderer.flipX</code> to flip the player but since it is made of three parts (body and two eyes), the <code>spriteRenderer</code> didn't work. Also, I couldn't convert them to a single sprite because I need the eyes in order to animate them. So, I decided to use <code>transform.localscale</code> for flipping and change <code>movementInput</code> value from a float to a Vector2. The problem is that when I press the arrow or AD keys to move the character, an error pops up saying &quot;Cannot read value of type Vector2 from composite&quot;. This error is from <code>InputActionState</code> which is a long and complicated code related to the new Input System. Also, getting input from gamepad causes the same error. I don't know what does this error mean and how can I fix it. Now, the player can jump but it can't move or flip. You can see the code, the error and my action map down below.</p>
  <p>This is my Player Controller:</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.InputSystem;
  
  public class PlayerController : MonoBehaviour
  {
      [SerializeField] private float speed, jumpSpeed;
      [SerializeField] private LayerMask ground;
      private PlayerActionControls playerActionControls;
      private Rigidbody2D rb;
      private PolygonCollider2D pol;
      private Animator animator;
      private bool facingRight = true;
      private Vector2 movementInput;
  
  private void Awake() {
         
      playerActionControls = new PlayerActionControls();  
      rb = GetComponent&lt;Rigidbody2D&gt;(); 
      pol = GetComponent&lt;PolygonCollider2D&gt;();
      animator = GetComponent&lt;Animator&gt;();   
        
     }
  
  private void OnEnable() {
  
      playerActionControls.Enable();
  
     }
  
   private void OnDisable() {
  
      playerActionControls.Disable();
     }
  
   void Start()
     {
       playerActionControls.Land.Jump.performed += ctx =&gt; Jump(ctx.ReadValue&lt;float&gt;());
  
      }   
  
  private void Jump(float val) {
         if (val == 1 &amp;&amp; IsGrounded()) {
             rb.AddForce(new Vector2(0, jumpSpeed), ForceMode2D.Impulse);       
         }
     }
       
  
  private bool IsGrounded() {
    
         Vector2 topLeftPoint = transform.position;
         topLeftPoint.x -= pol.bounds.extents.x;
         topLeftPoint.y += pol.bounds.extents.y;
  
         Vector2 bottomRightPoint = transform.position;
         bottomRightPoint.x += pol.bounds.extents.x;
         bottomRightPoint.y -= pol.bounds.extents.y;
  
         return Physics2D.OverlapArea(topLeftPoint, bottomRightPoint, ground);
     }
       void FixedUpdate()
     {    
         if(facingRight == false &amp;&amp; movementInput.x &gt; 0){       
             Flip();
         } else if (facingRight == true &amp;&amp; movementInput.x &lt; 0){        
             Flip();    
         }
     }
     void Flip(){
          facingRight = !facingRight;
          Vector3 Scaler = transform.localScale;
          Scaler.x *= -1;
          transform.localScale = Scaler;
     }
    
     void Update()
     {
         Vector2 movementInput = playerActionControls.Land.Move.ReadValue&lt;Vector2&gt;();
         
         Vector2 currentPosition = transform.position;  // This was a Vector3 but since I got the error  &quot;Operator '+=' is ambiguous on operands of type 'Vector3' and 'Vector2&quot;, I changed it to a Vector2.
         currentPosition += movementInput * speed * Time.deltaTime;
         transform.position = currentPosition;
       
     }
  }
  </code></pre>
  <p>This is the error I get when I want to move the player.
  <a href="https://i.stack.imgur.com/fZyXz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fZyXz.png" alt="enter image description here" /></a></p>
  <p>This is my action map.</p>
  <p><a href="https://i.stack.imgur.com/iQ4H6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iQ4H6.png" alt="enter image description here" /></a></p>