Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var clicksToStop :int = 2;
- var delay : float = 0.5;
- private var clicks = 0;
- function Start()
- {
- MoveUntilClicked();
- }
- function MoveUntilClicked()
- {
- clicks = 0;
- while (clicks < clicksToStop)
- {
- transform.position = Random.insideUnitCircle*3;
- yield WaitForSeconds(delay);
- }
- }
- function OnMouseDown()
- {
- clicks +=1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement