Guest User

Untitled

a guest
Dec 7th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Controller : MonoBehaviour {
  6. public Transform prefab;
  7.  
  8. // Use this for initialization
  9. void Start () {
  10. for (int i = 0; i < 300; i++)
  11. {
  12. float x = Random.value - 0.5f;
  13. float y = Random.value - 0.5f;
  14. float z = Random.value - 0.5f;
  15. Vector3 thisPos = new Vector3(x, y, z);
  16. thisPos *= 5.0f;
  17. thisPos.x += -15;
  18. thisPos.y += -15;
  19. thisPos.z += -15;
  20. Transform temp = Instantiate(prefab, thisPos, prefab.rotation);
  21. }
  22.  
  23. }
  24.  
  25. // Update is called once per frame
  26. void Update () {
  27.  
  28. }
  29. }
Add Comment
Please, Sign In to add comment