I'm making a mobile game and am trying to make it so you can only shoot when touching the right half of the screen. I can't figure out how I would do this

I put in an extra parameter to the if statement for GetButtonDown but I did something wrong.
The error is under “position” in line 28.

Error CS1061 ‘bool’ does not contain a definition for ‘position’ and no accessible extension method ‘position’ accepting a first argument of type ‘bool’ could be found (are you missing a using directive or an assembly reference?) Assembly-CSharp C:\Users deck\First 3D Mobile Game\Assets\Flare Gun\Scripts\Flaregun.cs 28 Active

using UnityEngine;
using System.Collections;

public class Flaregun : MonoBehaviour {

public Rigidbody flareBullet;
public Transform barrelEnd;
public GameObject muzzleParticles;
public AudioClip flareShotSound;
public AudioClip noAmmoSound;	
public AudioClip reloadSound;	
public int bulletSpeed = 2000;
public int maxSpareRounds = 5;
public int spareRounds = 3;
public int currentRound = 0;

private float halfScreenWidth;

private void Start()
	halfScreenWidth = Screen.width / 2;

// Update is called once per frame
void Update () 
	if(Input.GetButtonDown("Fire1") && !GetComponent<Animation>().isPlaying && Input.GetButtonDown("Fire1").position.x < halfScreenWidth)
		if(currentRound > 0){
	/*if(Input.GetKeyDown(KeyCode.R) && !GetComponent<Animation>().isPlaying)


void Shoot()
	if(currentRound <= 0){
		currentRound = 0;
		Rigidbody bulletInstance;			
		bulletInstance = Instantiate(flareBullet,barrelEnd.position,barrelEnd.rotation) as Rigidbody; //INSTANTIATING THE FLARE PROJECTILE
		bulletInstance.AddForce(barrelEnd.forward * bulletSpeed); //ADDING FORWARD FORCE TO THE FLARE PROJECTILE
		Instantiate(muzzleParticles, barrelEnd.position,barrelEnd.rotation);	//INSTANTIATING THE GUN'S MUZZLE SPARKS	

void Reload()
	if(spareRounds >= 1 && currentRound == 0){


Input.GetButtonDown(“Fire1”) does not have a position, so you can not access its position. You need to get the touch and the location of that. Here is the documentation for touch:

You might find the answer on this page to be what you need:

or if you are using the new input system here is a video tutorial for that:

Be sure to search for answers before you post, google and youtube are your friend, as well as microsoft and W3 schools for learning C#. Don’t for get to upvote and wish me a happy 500th answer! Follow for more answers.