i enabled gravity for those particles and it works perfect except of a problem. it’s usable only for static objects like bonfire where we always know that direction of particles will be up.
I need to create directional particles for movable object. and particles should have direction based on direction of mesh (for example i want to create tail with fire on the end of it) i can’t use gravity for this because gravity is a static direction.
i found that i can enable isLocal parameter for particles. in that case it works perfect for tail but i have another problem. There is no shlave of particles. it looks unnatural. To see what i mean try to uncomment 37line of code and use next parameters
Final perfect result for me is particles assigned to mesh with dynamic direction of mesh and shlave. is there any way to do this without writing some custom functions which calculates gravity vector and assign it each tick?
I think you might be confusing particle speed and particle acceleration.
Gravity param exists because if you want particles to accelerate, most likely it will be due to gravity, which is always one direction (For example, hot smoke out of a fire, regardless of if the fire emitter moves, or not)
Another param that you are not using here is particle emit direction. (See line 41 on this Playground) which can be in any direction rotate with a mesh, etc… For example that’s what I used for this rocket in a game I made a few years ago :
Thanks for the answer
Actually i tried to use those direction1, direction2 parameters but they did nothing and i found that it’s because i used sphere emitter. also direction1 and direction2 have such docs which are confusing too :
Random direction of each particle after it has been emitted, between direction1 and direction2 vectors. This only works when particleEmitterTyps is a BoxParticleEmitter
“Babylon.js docs”
so i found that i can create directed sphere emitter and after that direction1 and direction2 started to work
particleSystem.createDirectedSphereEmitter(1, new BABYLON.Vector3(-1, 8, -1), new BABYLON.Vector3(1, 8, 1));
Thanks for help