Snapping Mouse Position to specific location when un-pausing

I have an object that slides left-right based on the user’s mouse position and it works perfectly. When the user pauses the game, the user looses control over the object (it’s paused… so this is as expected and as wanted). The issue the springs up is that when the user un-pauses the game, the object then snaps to wherever the user has moved the mouse while the game was paused instead of starting where its last resting place was.

I’m using the following for the code:

function Update () {
	
	if (GlobalVariables.paused == false) {
		// Captures the current mouse position -- Vector3()
		var mPos = Input.mousePosition;
		
		// DELETED CODE TO LIMIT ON X-AXIS TO SIMPLIFY SCRIPT FOR THIS QUESTION
		
		// Converts mouse position to world coordinates
		var currentPos = cam.camera.ScreenToWorldPoint(mPos);

		// Moves the object to where the mouse is
		transform.position = currentPos;
	}
}

I tried to use:

Input.mousePosition = Vector3( x, y, z);

… but it says that it’s read-only.

Again, I basically am looking for a way to snap my the user’s mouse cursor to the location of the gameObject when un-pausing the game.

Thanks in advance as this seems like a simple task, yet I can’t seem to find this answer anywhere.

I don’t think you can set the mouse position through unity. If that is true, what about:
keeping the game paused until the user moves the mouse back over the object -or-
using an offset to the mouse position after pause and not using the system pointer but drawing your own pointer.

Thanks for the response. What I ended up doing was revamping my code. Instead setting the “mover” object to the current mouse position, I am now using the “Input.GetAxis (“Mouse X”)” to move the object back and forth and it works great, actually. Doing it this way also allows me to multiply it by a “mouseSpeed” to allow for sensitivity settings. Thanks again for the response.