I am trying to create match 3 game like candy crush while learning unity.
How can i store references of two gameobjects(object) which are to be swapped on android device?
On computer it is working fine i did it using onMouseDown() on gameobject and having two gameobject references to store selected objects in gamecontroller script.
Thanks for any help and suggestion and sorry for bad English.
If you are asking just how to touch these objects:
if (Input.touchCount == 1)
{
Vector3 worldPos = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position);
Vector2 touchPos = new Vector2(worldPos.x, worldPos.y);
if (collider2D == Physics2D.OverlapPoint(touchPos))
{
//Do stuff with it here like check gameObject tags and such.
}
}