Two player touch screen

I’m trying to create a game in which two players play on the same device. One player (hereinafter Player1) will control a character while the other player (hereinafter Player2) spawns enemies. Player 1 moves with a simple raycast script to follow the finger. It is detected as Mouse(0). Inside a rectangle that is the bottom half of the screen, a Mouse(1) hit makes the Player1 attack. This all works just fine.
The issue comes when trying to spawn the enemies. I cannot work out touchId or get it to identify as any mouse buttons when I click the spawn button. I have tried GUI.button, GUItexture, and detecting touches within a rectangle. If Player(1) is moving, Player2 cannot spawn enemies. I am coding in C#. I can post scripts if needed. Thanks in advance.

Are you using code like this? I just managed to get my working for two player touch input.

if (Input.touchCount == 1) {
			Touch touch = Input.GetTouch(0); 

else if (Input.touchCount == 2) {
			Touch touch = Input.GetTouch(0); 
			Touch touch2 = Input.GetTouch(1); 

Hope i helped you :slight_smile: took me few days