Adding particle effects
by Aditya Kulkarni · in Torque Game Builder · 01/15/2010 (4:36 am) · 2 replies
am really confused about adding particle effects to the scene...am able to create the effect just fine and i can see it in the library...how do i use it in the scene?
this is what i tried, with no results...:(
gave me this:
t2dParticleEffect::playEffect() - Cannot Play; no emitters!
so i added the following to the above code...
gives me this now:
t2dParticleEffect::playEffect() - Cannot Play; not in a scene!
this is what i tried, with no results...:(
new t2dParticleEffect(effect1) {
effectFile = "subtle_ripple";
useEffectCollisions = "0";
effectMode = "INFINITE";
size = "16 16";
position = "0 0";
scenegraph = t2dSceneGraph;
};
effect1.playEffect();gave me this:
t2dParticleEffect::playEffect() - Cannot Play; no emitters!
so i added the following to the above code...
%emitter = effect1.findEmitterObject("defaultEmitter");
%emitter.clearDataKeys();
// Add our keys.
%emitter.addDataKey( 0.0, 0 );
%emitter.addDataKey( 0.5, 5 );
%emitter.addDataKey( 0.9, 20 );
%emitter.addDataKey( 1.0, 50 );gives me this now:
t2dParticleEffect::playEffect() - Cannot Play; not in a scene!
Torque Owner Aditya Kulkarni
Loon Games
was calling playEffect before creating the effect...*sheepish grin*