using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpawnHitVFX : MonoBehaviour { public GameObject ImpactPrefab; public GameObject go; // Start is called before the first frame update public void Impact() { var impact = Instantiate(ImpactPrefab, go.transform.position, Quaternion.Euler(0, 0, 0)); Destroy(impact, 2); } }