[SOLVED] My background size is half of the size of background which Ben teaching and My paddle is not starting from the centre where I am pointing the mouse what changes I do in the code?

void Update () {
	Vector3 paddlePos = new Vector3(0.5f, this.transform.position.y, 0f);
		
	float mousePosInBlocks = Input.mousePosition.x / Screen.width * 16;
		
		
	paddlePos.x = Mathf.Clamp(mousePosInBlocks, 0.5f, 15.5f);
		
	this.transform.position = paddlePos;
}

Hello Manthan, welcome to the community :slight_smile:

Could you post a screenshot also please, with the Paddle selected within the Hierarchy, so that it’s details are available in the Inspector.


See also;

Privacy & Terms