Particle System works in editor but not build

I’ve been making a manager for decals on walls that conforms to the face by normals and it mainly consists of a particle system that uses .emit to put out a single particle (in this case the decal) at the point and normal vector of a collision that can be passed to the method. It works beautifully in the editor without any problems from 1 particle to 1000 at any point, but as soon as I try to open up a build of the game the blood doesn’t appear at all. I’ve tried switching shaders, double sided shaders, and all of the options I can think of in the inspector, but since the particles are emitted through code I don’t really use any of the modules so all I can extensively check are renderer and main settings. I also tried putting the system directly in front of camera as a child, but no luck. I have included screenshots below of the system’s settings and a picture of the decals working in the editor and code below.

I’ve been stumped for a while now by this and I would really appreciate to hear what you guys think can help me out. Thank you in advance!

private ParticleSystem ps;

void Start()
{

    ps = gameObject.GetComponent<ParticleSystem>();

}

public void SpawnBlood(Vector3 pos, Vector3 normals)
{

    float x = normals.x * .01f;
    float y = normals.y * .01f;
    float z = normals.z * .01f;
    // moving position away from wall

    var emitParams = new ParticleSystem.EmitParams();
    emitParams.position = pos + new Vector3(x, y, z);
    emitParams.rotation3D = Quaternion.FromToRotation(Vector3.forward, normals).eulerAngles;

    ps.Emit(emitParams, 1);
    //Debug.Log(normals);
   
}

Time to isolate… construct small nearly-empty scene experiments :

  • can you get that particle to emit at all?

  • if not, fix that… perhaps look at the device log for shader errors

If you can see particles, time to bisect back to your main scene where it doesn’t work.

Is it lighting? Shadows? Layering? something else?

Slowly morph the empty functional scene back into your main setup, halfway at a time.

Thank you for the suggestions Kurt, and it’s an honor to have you help me like I’ve seen in so many posts I’ve googled. I decided to do exactly that, and after some weird troubleshooting I determined that it was being prevented by my spawning code not detecting my wall objects isStatic as true during the build only, though I’m not sure why. I’m just going to forgo that line though as I don’t have many dynamic objects marked as a wall. Case closed!

Ok after some more research I am finding that .isStatic is editor only. Silly me !

1 Like