I\'m trying to move a object to the mouse position. But it\'s giving me large x value like 300 but at that place the pre placed object\'s x position is -4.
If you wanted to use the new Unity InputSystem you could do the following:
using UnityEngine;
using UnityEngine.InputSystem;
...
Vector2 screenPosition = Mouse.current.position.ReadValue();
Vector2 worldPosition = Camera.main.ScreenToWorldPoint(screenPosition)
Note that you need to install the InputSystem package for this to work.