I would like a button in my gui menu to follow a specific path if we selected it, I am wondering how I could do it: if we touch the button, then it can only move on the specific path, it is an arc such as this path :
Would you know how to achieve this? I am using Unity, but I think the theory should be the same for other software/language ?
Thanks for your help
__
EDIT:
here is the code for the bezier curve in unity : Where should I put the script?
using UnityEngine;
using System.Collections;
public class DrawBezierHandle extends Editor {
public Transform startT;
public Transform endT;
function Start(){
startT = GameObject.Find("start").GetComponent("Transform") as Transform;
endT = GameObject.Find("end").GetComponent("Transform") as Transform;
}
function OnSceneGUI() {
var width : float = HandleUtility.GetHandleSize(Vector3.zero) * 0.1;
Handles.DrawBezier(startT.position,
endT.position,
startT.position * 5 * Vector.up,
endT.position * 5 * Vector.up,
Color.red,
null,
width);
}
}