Simultaneous button presses

Hello

I want to make my two buttons work parallely…

In my case ,I am having One button which allows my player to move left and right and other is fire button which continuously fire…

PlayerMove Button works with Input.GetMouseButtonDown(0) in Update() and for fire it is GUI button in OnGUI()…

Now i wants to make this two button works togather…

For that i want some ideas… as i search but did not get anything…

So please help me…

Thanks for your support and advice…

Use a boolean variable and set it to true when button 1 is pressed. Then do a check in the second button detection code to see if the first one is pressed.

Remember to reset it to false when appropriate

I have solved my problem using touch…

for(var touch : Touch in Input.touches)
	    {
	    	if(touch.phase == TouchPhase.Stationary)
	    	{
	    		var hit  : RaycastHit;
	       	    var ray  : Ray = Camera.mainCamera.ScreenPointToRay(touch.position);
	       	    if (Physics.Raycast(ray,hit))
		        {
		            if(hit.collider.gameObject.GetComponent("ButtonId"))
		            {
		                buttonPressed = hit.collider.gameObject.GetComponent("ButtonId");
		                if(buttonPressed.id == "RightMove")
		                {    
		                	MovePlayerRight();
		                	Debug.Log("right");
		                }
		                if(buttonPressed.id == "Fire" && Time.time > nextFire)
		                {    
		                	nextFire = Time.time + fireRate;
			 				HandleBullet(); 
		                }
		                if(buttonPressed.id == "LeftMove")
		                {    
		                	MovePlayerLeft();
		                	Debug.Log("left");
		                }
		            }
		        }
	    	}
	    }

Now my player moves also and fire also parallely on button touch/press… This all i want to do…

Thanks…