Hey, I am working on a game where you tap a square and it changes position. But, I have a problem where the square jumps to a random position and instantly jumps back. I also want the square to be inside the pov in a better way than i have now. Can someone please help me?
I am writing in JavaScript
#pragma strict
var Counter : int = 0;
function Start () {
}
function Update () {
if(Input.GetKeyDown(KeyCode.Mouse0))
var newPosition : Vector2 = Random.insideUnitCircle * 5;
transform.position.x = newPosition.x;
transform.position.y = newPosition.y;
if(Input.GetKeyDown(KeyCode.Mouse0))
Counter++;
Debug.Log ("transforming");
}
↧