Simple Instantiate code snippet

June 21, 2015

 

 

Simple code snippet 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

using UnityEngine;

using System.Collections;

public class VFXspawn : MonoBehaviour

{

public GameObject vfxPrefab;

public GameObject Original;

public Transform SpawnPoint;

 

void Update()

{

if(Input.GetKeyDown(KeyCode.Mouse0))

{

Instantiate(vfxPrefab, SpawnPoint.position, SpawnPoint.rotation);

Destroy(Original);

GetComponent<AudioSource>().Play();

}

}

}

 

 

 

Please reload

Featured Posts

Simple Instantiate code snippet

June 21, 2015

1/2
Please reload

Recent Posts
Please reload

Archive
Please reload