Particle Systems play on addToLevel
by Devin Horsman · in Torque Game Builder · 01/25/2010 (11:27 am) · 1 replies
When additively loading a scene, all existing particle effects play in the scene.
Anyone has a fix, I'd like to see it, in the meantime, I'm working on one.
Anyone has a fix, I'd like to see it, in the meantime, I'm working on one.
About the author
Game developer from Halifax Nova Scotia.
Torque Owner Devin Horsman
In t2dParticleEffect.cc replace readFieldsPostLoad with
void t2dParticleEffect::readFieldsPostLoad() { //playEffect(true); // DEVIN [ http://www.torquepowered.com/community/forums/viewthread/109839 ] Parent::readFieldsPostLoad(); }in the torquescript file levelManagement.cs in the scenegraph::addToLevel function, before
add:
// fix particle effect problems. for(%i = 0; %i < $LevelManagement::newObjects.getCount(); %i++){ %obj = $LevelManagement::newObjects.getObject(%i); //echo("Looping" SPC %obj.getClassName()); if(%obj.getClassName() $= "t2dParticleEffect"){ //echo("playing effect"); %obj.playEffect(true); } }