Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [SerializeField]
- GameObject Prefab;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- SpawnPrefab();
- }
- void SpawnPrefab()
- {
- if (Input.GetMouseButtonDown(0))
- {
- GameObject gameObject = Instantiate(Prefab, transform.position, Quaternion.identity) as GameObject;
- }
- }
Add Comment
Please, Sign In to add comment