Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Particles moving towards an actor.  (Read 3658 times)

0 Members and 1 Guest are viewing this topic.

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Particles moving towards an actor.
« 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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Particles moving towards an actor.
« Reply #1 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);
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Particles moving towards an actor.
« Reply #2 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.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Particles moving towards an actor.
« Reply #3 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.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.073 seconds with 24 queries.