Guest User

Untitled

a guest
Oct 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public GameObject ball;
  2.  
  3. int count = 0;
  4.  
  5. // Use this for initialization
  6. void Start () {
  7.  
  8. }
  9.  
  10. // Update is called once per frame
  11. void Update () {
  12.  
  13. if (count < 10) { // if teh count is less tahn zero then decrease count by one.
  14. if (Input.GetKeyDown (KeyCode.Space)) {
  15. count += 1;
  16. Instantiate (ball, new Vector3 (Random.Range (0, 0), 6f, 0), Quaternion.identity);
  17.  
  18. }
  19.  
  20.  
  21. }
  22. }
Add Comment
Please, Sign In to add comment