Game Development Community

Play the exact particle effect?

by Robert Carroll · in Torque Game Builder · 10/11/2009 (9:29 pm) · 2 replies

Is there a way to make a behavior that plays the particle thats being clicked on? Im trying to mount a particle effect to my gun barrel. So I want it to play that particle effect not its clone.

#1
10/11/2009 (11:58 pm)
It's pretty simple really. First, give your particle effect a unique name. Then modify your behavior to have a field which takes that name. (It could just be a string, but I think there is also a way to have a field list the instances already in the scene.)
#2
10/12/2009 (3:42 am)
Wait Im a newbie But heres waht I got.
=========
function MouseClickSoundBehavior::onMouseDown(%this, %modifier, %worldPos)
{
%this.fire(1);
%explosion = %this.particleEffect.cloneWithBehaviors();
%explosion.position = %position;
%explosion.setEffectLifeMode("Kill", 1.0);
%explosion.playEffect();
}
}
=========
I got this from a behavior I didn't write I tried to merg then but it dosn't want to play it. Do I just do Play effect but do "%this.playeffect(shooteff);"?