Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public GameObject ball;
- int count = 0;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (count < 10) { // if teh count is less tahn zero then decrease count by one.
- if (Input.GetKeyDown (KeyCode.Space)) {
- count += 1;
- Instantiate (ball, new Vector3 (Random.Range (0, 0), 6f, 0), Quaternion.identity);
- }
- }
- }
Add Comment
Please, Sign In to add comment