Game Development Community

Setting position of particle effect affects emitters right?

by Rob Segal · in Torque Game Builder · 07/05/2006 (9:51 pm) · 3 replies

When setting the position of a particle effect I don't have to set the position on all the emitters for that effect as well right? Seems reasonable and I have injected some echo commands into my scripts that indicate that is indeed happening but the emitter I have for the effect remains in the same position all the time. Would there be a reason anyone can think of for this? Perhaps a flag or setting on the emitter?

#1
07/05/2006 (9:56 pm)
Don't you love when you find the answer to your question right after you pose it? Let us examine my script for this exercise...

The current script...
%effect = new t2dParticleEffect() { scenegraph = sgMain; };
%effect.setPosition(KittyTorso.getPosition());
%effect.loadEffect("~/data/particles/KittyParticles.eff");
%effect.playEffect();
This will constantly display the particle effect in the same position. If you query the effect for it's position it will tell you it's changing according to the value of the KittyTorso object. Not expected behavior! The call to setPosition needs to happen after the call to loadEffect. Wasn't necessarily what I was expecting but it makes some sense.

The revised working script...
%effect = new t2dParticleEffect() { scenegraph = sgMain; };
%effect.loadEffect("~/data/particles/KittyParticles.eff");
%effect.setPosition(KittyTorso.getPosition());  <-- setPosition now after loadEffect
%effect.playEffect();
#2
07/05/2006 (10:46 pm)
=o

I want kitty particles!
#3
07/06/2006 (4:44 pm)
There ya go...

66.49.229.127/gg/KittyParticles.jpg
Don't tell me I never did anything for you. :)