- Home /
Unity 5.3.4 - Particles from Prefab will not instantiate.
I've been trying to figure this out for hours. When I collide with an object, it is supposed to create an instance of a prefab containing a particle system. However, no matter what I try to do, no particles will appear in either the build or during gameplay. I see them nowhere in the level or in the Hierarchy. When I print out the instantiated variable, it always tells you that it exists, despite nothing actually happening.
public GameObject player;
public GameObject particleFx;
private int count = 0;
private AudioSource audioSource;
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
GameObject particles = Instantiate(particleFx, transform.position, transform.rotation) as GameObject;
}
}
What's happening and how can I fix it? I have been told to just parent a prefab of the particles to the object and turn it on or off manually.
Thanks!
Your answer
Follow this Question
Related Questions
Destroy particles based on bounds not lifetime 0 Answers
Assign random start lifetime for particle system from script 2 Answers
Can you change the Velocity Over Lifetime of a Particle System using a Script? 3 Answers
How to make an effect in a particle system so that it is always behind the sphere? 1 Answer