Jump to content
GreenSock

Mark

Align Particles to Motionpath in Pixi

Go to solution Solved by Cassie,

Recommended Posts

Hello,

I've been working on some simple sprite animations with pixi and greensock.  The idea is a glowing ghostly blob that leaves a trail of footprints behind it.

I'm pretty close to the effect I want but the footstep particles are always straight up in down not respecting the autorotate.

Any advice or guidance would be warmly received.
 

Sincerely,

 

Mark

See the Pen MWQQXrN by motionproto (@motionproto) on CodePen

Link to comment
Share on other sites

oh wow... i added an arrow to the sprite to confirm that it was auto-rotating... its going crazy!

 

Link to comment
Share on other sites

ghostNull.rotation = ghostNull.rotation * (Math.PI/180)

I added this to the pixi update loop and that fixed it. (once i set autorotate: 90) Looks like MotionPath is degrees only?  tried wrapping in pixi:{} but failed...

now just need to get particle emitter to inherit rotation....

See the Pen abqqjLE by motionproto (@motionproto) on CodePen

Link to comment
Share on other sites

  • Solution

Hey there, thanks for being part of Club GreenSock!

 

There's a lot of code here for my sunday evening brain and I'm not super versed on PIXI.

For now - GSAP-wise you can set useRadians to true

See the Pen KKQQrZM?editors=1010 by GreenSock (@GreenSock) on CodePen



I'll take a little look at the pixi emitter bit tomorrow and see if I can offer any advice there!

  • Like 1
Link to comment
Share on other sites

Turns out a particle must have at least some velocity (ie: .001) at birth or the Emitter.rotation will not be applied.

 

problem solved.

Use radians! didn't know that was possible. Thank you!

  • Like 1
Link to comment
Share on other sites

Hooray! Teamwork - high five!

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×