Ataching particle emitters to objects

i wanted to know how can i attach a particle emitter to an object, for example a vehicle emitting smoke while moving?

vehicle.attachChild(smoke) :stuck_out_tongue: ?

yeah, i though that too but i couldn’t find way to do it.

for testing, i made a cube with physics and a particle emitter but i couldn’t find a way to “join” them, also tried making a node and adding them both as children but they still move independently (not quite what i wanted but it was for testing).

what do u mean about “but i couldn’t find way to do it.”?

i mean that the box geometry doesn’t have a attachChild method

This tutorial explains why, you can only attach other Spatials (like Geometries) to Nodes:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies

@alexmania: you have to hold particle emitter AND object in one node(LINK LIKE NORMEN SAID), then use node position as object and particle emitter position in the same time





for you next think: note that particle emitter have “setInWorldSpace” what say if emmited particles are moving with emmiter or they have their “own” position(so emmiter is moving to other place but emmited particles stay in old to end of life)

2 Likes

thanks for the replays, i do realize that i could just move them under a node but my question was if there was another way, one that would allow a physical object to “drag” a particle emitter with it like having a sphere rolling down a slope with gravity and releasing dust as it rolls without having to fake it.

i apologize for my bad phrasing, it’s quite a bit late where i live

…group them in a node and then add a physics control to that…

1 Like

if there would be possibility normen would tell it at start of discussion. He gived you a link trying to say: Use the node!

oh! add the physics control to the node, i was looking at it all wrong, now i feel kind of dumb =p

thanks for the replys