Game Development Community

Spawn a particle emitter ?

by ... · in Torque Game Engine · 08/29/2006 (9:43 am) · 2 replies

Hi

I want to spawn a particleemmiter on a certain postions . How should i do this ?

%smoke = new ParticleEmitterNode()
{
dataBlock = "testSmokeEmitterNode";
//sourceObject = %obj.sourceObject; //what are these for ?
//sourceSlot = %obj.sourceSlot; ...
//client = %obj.client; ...
position = %vec;
};

MissionCleanup.add(%smoke);


tnx,
Robin.

#1
08/29/2006 (10:02 am)
Take a look at the particle editor scripts for an example of how to do this.

This is how I spawn projectiles, same theory applies to particle nodes:

%p = new (projectile)()

  {
     dataBlock = explosionProjectile;
     initialVelocity  = 3;
     initialPosition  = %obj.getPosition();
     sourceObject     = %obj;
     sourceSlot       = 2;
   };

  MissionCleanup.add(%p);
#2
08/29/2006 (10:26 am)
This is how it works

....
%smoke = new ParticleEmitterNode()
{
emitter = testSmokeEmitter;
velocity = 1;
position = %vec;
rotation = "0 0 0";
datablock = testSmokeEmitterNode;
};

MissionCleanup.add(%smoke);
....

Tnx Tim . I found it in the particleEditor scripts.