Hi!
Im trying to recreate the animation on menu at the start the game, when you moves the mouse:
But that’s what i have made until now:
That’s the script that i have made:
public class movimiento : MonoBehaviour {
private Transform thisTransform = null ;
public float posisionx;
public float posisiony;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
posisionx = Input.mousePosition.x;
posisiony = Input.mousePosition.y;
Debug.Log(posisionx + "px " + posisiony + "px");
thisTransform = GetComponent<RectTransform>();
thisTransform.position = new Vector2(posisionx, posisiony);
}
}
How can i made that? i’ve thinking multiplying the variables posisionx and posisiony with 0.2, but by the “slow” i dont know what should i do.