Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: piere on June 17, 2011, 09:22:33 PM

Title: Particles moving towards an actor.
Post by: piere on June 17, 2011, 09:22:33 PM
Is it possible to make a particle emitter move or follow an actor? I was thinking about doing the SkipTo command while looping but I can't figure out how to make it go towards the actor. Thanks
Title: Re: Particles moving towards an actor.
Post by: Mnemonic on June 17, 2011, 10:33:06 PM
See the documentation for CreateParticleEmitter. It has an optional 'FollowOwner' parameter (plus an optional offset).

var emitter = actor.CreateParticleEmitter(true);

or

var emitter = actor.CreateParticleEmitter(true, offsetX, offsetY);
Title: Re: Particles moving towards an actor.
Post by: piere on June 17, 2011, 10:40:40 PM
Thanks, but I think I said it wrong. I want a particle to start to follow an actor from across the room. So it will be like the particle will float or walk to the actor, not just be on the actor right away.
Title: Re: Particles moving towards an actor.
Post by: metamorphium on June 18, 2011, 04:44:35 PM
I'd create an entity and wrote a simple tracking script which would get the vector from its position to current actor's position and move along that vector for each tick (this will make the entity follow the actor). Then I'd attach particle emmiter to that entity.