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
)