Not getting a cloned ParticleEmitter to show

Hi,

I have a problem with ParticleEmitters, I’m using .clone() on a set particleEmitter to create a new ParticleEmitter and attach to a node and to the rootNode, since i’m trying to have more emitters of the same.



The problem i’m having is that it will only be “playing” one of the emitters (or so I think it is).

I got the animations attached to a node containing an also cloned Spatial and Gemoetry - making it like a Fireball.

I can cast away and have more than one ball at a time. the Model and Geometry is copied and displayed, but the smoke-trail (that is the particleemitter), only displays on the most recently attached node. first Fireball will have smoke, spawn a second Fireball and it will have smoke, but ball one won’t anymore, if ball two dies before ball one then ball one gets its smoke back.



When i’ve created another seperate particleEmitter, not from .clone(), it can be displayed at the same time as the first, but cloning that will cause it to have the same problem.



Any help appreciated :slight_smile:

Thanks, there were a bunch of issues with particle cloning it seems.

Fixed in SVN now

Sweet :stuck_out_tongue:

managed tho to get a workaround by cloning a node that had attached ParticleEmitters.

But I have been using the Alpha up until now. Gonna go over to the SVN, will have to cleanout the oudated methods and probably go back to trying cloning the emitters :slight_smile:

Well wasnt much to change, not that much code.

Tho for some reason the effects now spawn at (0,0,0) eventho they are attached to the moving objectnode.

Edit: tried to varify it more. I did this.

[java] player.getNode().attachChild(smokeTail);[/java]

player.getNode() returns the pointer to the Node-object that got various other nodes attached to it.

Doing that attachment of the “smokeTail” ParticleEmitter made the ParticleEmitter follow the player-model as I was expecting.

So I redo the same line into being the following instead:

[java]player.getNode().attachChild(smokeTail.clone());[/java]

Now that makes the smoke visible , but stationary at (0,0,0), Which I wasn’t expecting to happen.



EDIT: got a more recent Nightly, and it works for what I got inteded :stuck_out_tongue: