Game Development Community

particle material change

by Dan Pascal · in Torque X 2D · 02/05/2010 (2:47 pm) · 3 replies

does anyone know how to get at the particle material(or is it a staticSprite) in code?
...so I can switch it with another material


#1
02/05/2010 (4:19 pm)
Dan I have not tried it but if you have the T2DParticleEffect, it seems you can get at it like this.

T2DParticleEffect _foo;
_foo.CurrentEffectData.EmitterDataList[0].Material

Now if you have multiple emitters you will have to know which emitter is which. There is also a MaterialName in there, don't know if you have to deal with that as well.

I hope this is helpful.

#2
02/05/2010 (6:20 pm)
hey that worked thanks!

unfortunately, it changes the materials of the particles already emitted aswell,
any idea how i'd get around that one?
#3
02/19/2011 (12:06 pm)
Hey thanks a year later, that helped!