I am going to show you how to draw a swipe movement in Unity.
The final effect will be like this:
Here is the video showing how to do it:
And here is the script:
using UnityEngine; using System.Collections;</code> public class CursorBehavior : MonoBehaviour { private bool touched; // Use this for initialization void Start () { touched = false; //make it desappear GetComponent<MeshRenderer>().enabled = false; } // Update is called once per frame void Update () { //when screen touched -> update cursor position Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if(Input.GetMouseButtonDown(0)) { touched = true; } else if(Input.GetMouseButtonUp(0)) { touched = false; } else { if(touched == true) transform.position = ray.GetPoint(2); } } }