Shoot Particle at Direction

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Shoot Particle at Direction

Post by LunaRebirth »

Hello,

I'm working on a "magic" system, which I already have many finished.
However, one of my spells I'm trying to add is shooting water from the player node's hand, to in front of the player node.
Using the Box particles, I can easily make rising water bubbles, but I cannot figure out how to make it shoot in front of the player rather than up. I've tried changing the direction, but it seems the direction can only be changed if I make a new emitter and then set it. Which produces a lot of problems. I've looked at the rotational particles, but I don't think this allows to shoot at a direction.

I made an image representation of my issue:
Image

Any help is appreciated. I know there is probably a different particle method than the box I'm using, but I'm not sure which will complete my task.

Thanks!
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Shoot Particle at Direction

Post by hendu »

Make a custom affector that queries your player direction?
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Shoot Particle at Direction

Post by LunaRebirth »

I'm trying but I can't figure out how.
There is no "custom particle" system.
I looked over IParticleEmitter but there is no example or code on using it, and I cannot figure out if it will even complete my task or not
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Shoot Particle at Direction

Post by LunaRebirth »

Nevermind, got it:)
I made a Sphere emitter and found the facing on my node.
Then just set the direction of the emitter to the node facing (vector3df) variable.
Post Reply