particle emitter relative to movement?

I've been struggling with this for a little while.

I'm spawning particles to make a trail behind a circular actor. The actor is 20x20. With the goal of making it look like the particles are spawning behind the actor, I'd like to use the offset so they spawn at the visible edge of the actor.

The actor is always moving, interacting with other objects and bouncing around the scene. How can I set the emitter offsets (x and y) so it dynamically adjusts to the motion of the actor?

Thanks!

Comments

  • imjustmikeimjustmike Member Posts: 450

    Use global attributes that are constrained to the actor's x and y, then use those global attributes in the particle spawner?

    Or is the spawner in the actor itself?

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2017

    Emitter Offset:

    X = -10*cos( self.Rotation )
    Y = -10*sin( self.Rotation )

  • SocksSocks London, UK.Member Posts: 12,822

    Demo attached:

  • AdrenalineAdrenaline Member Posts: 523

    Thanks for the demo @Socks but I tried that already. I see how it works in your demo but for my particular case, that isn't the solution.

    Here's a stripped down version of my project here, maybe you could take a quick look?

    https://drive.google.com/file/d/0B0HfU3-sgNs5UkQtbVdlZDFNVDA/view?usp=sharing

    Thanks!

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2017

    @Adrenaline said:
    I see how it works in your demo but for my particular case, that isn't the solution.

    Maybe try . . . .

    -10*cos(vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y ))
    -10*sin(vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y ))

    ?

  • AdrenalineAdrenaline Member Posts: 523

    You're a beautiful person

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2017

    @Adrenaline said:
    You're a beautiful person

    Thank you.

  • AdrenalineAdrenaline Member Posts: 523

    @imjustmike said:
    Use global attributes that are constrained to the actor's x and y, then use those global attributes in the particle spawner?

    Or is the spawner in the actor itself?

    Also thank you for that suggestion! The reason it didn't apply here was because I have, potentially, a lot of actors spawning these particles...so using attributes to store the location could get heavy and cumbersome.

Sign In or Register to comment.