Trying to make a sliding menu but failed

Hello, again

It been a while and I failed to create the sliding menu. So I have to change what I want to do to be something else. So what I did is a selection menu that have next and previous button.

this is the script :

`var next : GameObject;
   var previous : GameObject;

   private var Next : int = 0;
   private var Previous : int = 0;

   function Update()
   {
	nextPrevious();
   }

   function nextPrevious()
   {
	var ray = Camera.main.ScreenPointToRay (Input.mousePosition);	

	if (Input.GetMouseButtonDown (0)) //Returns true during the frame the user touches the object
	{			
		if (Physics.Raycast (ray, hit, 100)) 
		{	
			if(hit.collider.tag == "01") 
			{
				Next = (Next + 1);

				switch(Next)
				{
					case 1:
					//first page
					iTween.MoveTo(slideMove, {"x":-14.10812, "time":1});
					Previous = -2;
					break;

					case 2:
					//first page
					iTween.MoveTo(slideMove, {"x":-28.32634, "time":1});
					Previous = -3;
					break;	
				}
			}

			if(hit.collider.tag == "02") 
			{
				Previous = (Previous + 1);

				switch(Previous)
				{
					case -1:
					//first page
					iTween.MoveTo(slideMove, {"x":0.1617198, "time":1});
					Next = 0;
					break;

					case -2:
					//first page
					iTween.MoveTo(slideMove, {"x":-14.10812, "time":1});
					Next = 1;
					break;	
				}
			}
		}
	}
}
`

I still want to make the sliding menu, is there any other way to approach this? What I want to achive, something like this:

Example 01
Example 02
Example 03

Most of my reading that I did a lot of people used “onGUI function” and some used EZGUI. But can I do this with plane and not onGUI.

Sure can it be done with planes. You should setup all your items as childs in one GameObject that will be scrolled.

You need:

  • Touch to get the touch / dragging information
  • Transform to slide the GO.

It’s pretty easy. You might want to use iTween for the movement to get a “smooth” scrolling