Game Development Community

Noob particle emitter question

by John Bura · in Torque X 2D · 05/29/2010 (9:08 pm) · 4 replies

Sorry for the noob post but...

How Do I enable/disable particle emitters. Basically I want to put them on movable players and use them for weapons.I just don't know what the code is. :D

#1
05/30/2010 (2:47 am)
T2DParticleEffect variable;
variable.PlayEffect(false);
variable.StopEffect(true);

#2
05/31/2010 (6:43 am)
Thanks for the code. But Im not exactly sure how to get it to point to the particle effect I set up in TBX. :)
#3
05/31/2010 (7:40 am)
try this maybe, naming your effect "MyEffect"
T2DParticleEffect variable = TorqueObjectDatabase.Instance.FindObject("MyEffect") as T2DParticleEffect;

#4
05/31/2010 (8:02 am)
Here is the answer for anybody else who is looking to put a particle effect on enemy explosion. I made this with the Blaster tutorial :)
T2DParticleEffect variable = TorqueObjectDatabase.Instance.CloneObject<T2DParticleEffect>("ParticleEmitter"); 

variable.Position = ourObject.Position;
TorqueObjectDatabase.Instance.Register(variable);