the input system with the mouse position works weird

hi!, im trying to make an object follow the mouse with the new input system, my code looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class mouse : MonoBehaviour
{
    public List<playerMovement> player = new List<playerMovement>();
    Vector2 mouses;
   public SpriteRenderer sprite;
   public InputActionReference pointr;
    // Update is called once per frame
    void Update()
    {
       
        mouses = pointr.action.ReadValue<Vector2>();
        transform.position = mouses;

         //if (player[0].dragging == true)
        // {
          //  sprite.enabled = true;
         //}
        // else
        // {
         // sprite.enabled = false;
        // }



       
    }
}

but, for some reason, the object appears more on the upper right than on the mouse pointer itself, whats going on? ( im using the new input system for this

)

Hi there,
Are you using “DefaultInputActions” input action or you created a new one?
And do you use “EventSystem” component in the scene?

no im not using events, and yes im using a new input action that i made, its this

9196298--1282088--Sprite-00011.png
9196298--1282091--Sprite-0002.png

I think your problem looks like at this post .
So, the problem is UI System references to DefaultInputActions, not what you are created.
Try this : Add “EventSystem” in the scene and Change “Action Assets” of “Input System UI Input Module”.
But, if you do this, you have to manually assign the “Point”, “Left Click” and others events manually.

it… isnt working

9197951--1282583--Sprite-0001111.png

Your pointer’s position is screen space, however you need to convert it to a world space coordinate. There are plenty of relevant methods in the Camera class such as this one: Unity - Scripting API: Camera.ScreenToWorldPoint

Yes As @spiney said you have to convert position and also you should add some log to check “pointr.action.ReadValue()” is working?