Hello,
So I am new to unity and programming in general. I started with the mobile development tutorial and I’m also using the Unity Remote App just like him. The first code he starts with is:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TouchScript : MonoBehaviour {
void Update ()
{
}
void OnGUI()
{
foreach (Touch touch in Input.touches)
{
string message = "";
message += "ID: " + touch.fingerId + "\n";
message += "Phase: " + touch.phase.ToString() + "\n";
message += "TapCount: " + touch.tapCount + "\n";
message += "Pos X: " + touch.position.x + "\n";
message += "Pos Y: " + touch.position.y + "\n";
int num = touch.fingerId;
GUI.Label(new Rect(0 + 130 * num, 0, 120, 100), message);
}
}
}
Whenever I run the code and tap on my phone’s screen nothing comes up. None of the code shows any errors or issues. Is the problem with the code or could be something else? Let me know if you guys need more info.