- Home /
Particle Effect not instantiating in Game Build
Hey guys, I'm currently having an issue with a blood splatter particle effect I have on my unity game build. The particle effect instantiates in the Unity editor. However, when I build the game, the particles do not get instantiated, or I assume are not visible at all. Here is a sample code of the particle instantiation.
void OnTriggerEnter2D (Collider2D target)
{
if (target.tag == "Player")
{
if (this.tag == "Trap")
{
StartCoroutine(RestartGame());
Debug.Log("HIT");
playerMovement.enabled = false;
Destroy(Player);
Instantiate(blood, player.position, Quaternion.identity);
}
else if (this.tag == "Laser")
{
if (playerMovement.isCloaking == false)
{
StartCoroutine(RestartGame());
Debug.Log("HIT");
playerMovement.enabled = false;
Destroy(Player);
Instantiate (blood, player.position, Quaternion.identity);
}
}
}
}
I have seen others with similar problems on the forums but their questions being unanswered. I'm just hoping someone out there has a solution to this issue I am facing.
Answer by ShatterDawn · Jun 26, 2017 at 10:06 AM
Figured out the problem. I went into all the particle prefabs and went into the RENDERER MODULE. I set it on the front most sorting layer and set the order in layer to a positive number. This allows the particles to be rendered when the game is built.
Had the same problem as you : didn't work in build ; Actually it worked with no change when I switched to Dev Build or $$anonymous$$aster Build ; only Release build was problematic.
I followed your suggestion, and I get it work on Release build as well. Thx.
Answer by AquaBomber · Jun 25, 2017 at 09:28 AM
While building set the developement build setting to true aswell as script debugging.Also when you instantiate the blood put in a debug.log,ex. Instantiate (blood, player.position, Quaternion.identity); Debug.Log("Blood Instantiated"); Also check that while playing the .exe try different types of quality
Thank you for your response. I have done that, tried different resolutions as well. The particles still are not visible. I am checking from the output.log file, it seems that it is indeed being called however still not visible. The problem persists and I'm still thoroughly stumped.