Well I have this problem with the menus in my game. I want to have 2 menus that you can individually swipe to make them enter the screen and make them go back by swiping the other way (eg, Facebook). Code (CSharp): using UnityEngine; using System.Collections; public class MenuMover : MonoBehaviour { public static MenuMover instance; public bool swipedLeft; public bool swipedRight; public Vector3 addMenuEnd; public Vector3 addMenuStart; public Vector3 saveLoadMenuEnd; public Vector3 saveLoadMenuStart; public bool one; public GameObject addMenu; public GameObject saveLoadMenu; void Start () { instance = this; saveLoadMenuStart = saveLoadMenu.transform.position; addMenuStart = addMenu.transform.position; } void Update () { if(swipedLeft) { addMenu.transform.position = Vector3.Lerp(addMenu.transform.position , addMenuEnd , Time.deltaTime * 10); one = true; } if(swipedRight) { addMenu.transform.position = Vector3.Lerp(addMenu.transform.position , addMenuStart , Time.deltaTime * 10); one = false; } if(swipedLeft) { saveLoadMenu.transform.position = Vector3.Lerp(saveLoadMenu.transform.position , saveLoadMenuStart , Time.deltaTime * 10); } if(swipedRight && !one) { saveLoadMenu.transform.position = Vector3.Lerp(saveLoadMenu.transform.position , saveLoadMenuEnd , Time.deltaTime * 10); } } public void SwipeLeft () { swipedLeft = true; swipedRight = false; } public void SwipeRight () { swipedLeft = false; swipedRight = true; } } Sorry for they messy and probably expensive code. Please really need help! Thank You!
Are you looking for something like the minute 1:56 of this video? If so... i have made that using just camera animation... create two animation, one to go to left, and another one to return (the same one but inverted)... and interact them with animation.CrossFade