still draws object

How can I stop them getting drawn? I’ve created a number of particle objects and setting active to false has stopped them updating but they still get drawn on the screen.

If its a particle effect, everything you need to do is something like this:

function Update () { gameObject.particleEmitter.emit = false; }

It’s not a Unity particle emitter (I’m hoping I’m not confusing the issue by naming it so) as I wanted to use some primitive shapes for the particles.

The codes a bit long text wise because of my long variable names!

There are 3 instantiate lines in the loop as I’m creating and storing the reference to 3 different particle objects.

The objects are drawing at the default location 0,0,0 even though they are active = false

function Start () {
shipControlScript = playerShip.GetComponent(“ShipControl_script”); // reference to ship control script

explosionEventScript = explosionEvent.GetComponent("ExplosionEvent_script");

particleArray = new GameObject[shipControlScript.maxMissiles * explosionEventScript.numberOfParticles];

print("Array size = " + shipControlScript.maxMissiles * explosionEventScript.numberOfParticles);

// Setup the array with the pre-cooked prefabs - they are deactivated.
// The 3 in the following line is the amount of lines below. So if another particle type is added to this list
// the a += 3 should be changed to 4.
for (var a = 0; a != shipControlScript.maxMissiles * explosionEventScript.numberOfParticles; a += 3) {
	particleArray[a] = Instantiate(explosionEventScript.explodePart01, Vector3(0,0,0),  Quaternion.identity);
	particleArray[a].active = false;
	particleArray[a+1] = Instantiate(explosionEventScript.explodePart02, Vector3(0,0,0), Quaternion.identity);
	particleArray[a+1].active = false;
	particleArray[a+2] = Instantiate(explosionEventScript.explodePart03, Vector3(0,0,0),  Quaternion.identity);
	particleArray[a+2].active = false;
print("Particle array loaded OK");

}`enter code here

Ok I think I’ve found out what’s happened but I don’t know how to fix it.

I tried disabling the renderer and it still drew! So I checked the inspector and there is a mesh renderer in the prefab at the top level and a mesh renderer that is attached to the actual mesh and this isn’t disabled.

I would have thought that anything done to the prefab at the top level would trickle down to meshes underneith it?