It's great to know that our regular input is working, but you may want to check whether a game object in our scene has been touched so that we can react to it. In our case, to add something else for our player to do, we'll make it so that if the player taps an obstacle, it will be destroyed.
- In the PlayerBehaviour script, add the following new function:
/// <summary>
/// Will determine if we are touching a game object and if so
/// call events for it
/// </summary>
/// <param name="touch">Our touch event</param>
private static void TouchObjects(Touch touch)
{
// Convert the position into a ray
Ray touchRay = Camera.main.ScreenPointToRay(touch.position);
RaycastHit hit;
// Are we touching an object with a collider?
if (Physics.Raycast(touchRay, out hit))
{
// Call the...