Can I have some help on how to fix this issue thanks. I’ve tried setting ‘cube’ to a Vector 2 but that didn’t work.
using UnityEngine;
using System.Collections;
public class CubeScript : MonoBehaviour {
public GameObject cube;
Touch userTouch = Input.GetTouch(0);
// Use this for initialization
void Start () {
cube = GameObject.Find("Cube");
}
// Update is called once per frame
void Update () {
cube.transform.position = new Vector2(cube.transform.position.x, cube.transform.position.y);
if (userTouch.position == cube.transform.position) //this line underlined red
{
}
}
}