Guest User

Untitled

a guest
Dec 18th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. [SerializeField]
  2. GameObject Prefab;
  3.  
  4. // Use this for initialization
  5. void Start () {
  6.  
  7. }
  8.  
  9. // Update is called once per frame
  10. void Update () {
  11. SpawnPrefab();
  12. }
  13.  
  14. void SpawnPrefab()
  15. {
  16. if (Input.GetMouseButtonDown(0))
  17. {
  18. GameObject gameObject = Instantiate(Prefab, transform.position, Quaternion.identity) as GameObject;
  19. }
  20.  
  21. }
Add Comment
Please, Sign In to add comment