problem with particles

-Timo--Timo- Member Posts: 2,313
I am using particles in my project and I want the particles come out of 1 side of the actor, no matter how he rotates. so when he starts with coming out to the left and rotates 90 degrees the particles come out of the top. but I don't want them to start in the middle but on the edge of the actor.
does someone know how to fix this? hope I explained enough :)
thanks

Comments

  • -Timo--Timo- Member Posts: 2,313
    bump
  • RPRP Member Posts: 1,990
    edited July 2013
    Use the Emitter Offset to set the spawn location of the particles. It's under the Velocity/Position of the Particles Behavior. You can also set direction here.
  • -Timo--Timo- Member Posts: 2,313
    but thats the X and Y position, so when it rotates it I want it to rotate it. but when I rotate the actor, the particles stay on the same position. (so I want them to move in a circle when the actor rotates)
  • TheSkinTheSkin Member Posts: 74
    you can use trigonometrics functions.

    In my actor have a similar problem .

    I set the offset in this mode:
    EmitterOffsetX=cos( self.Rotation )* self.Size.Width /2
    EmitterOffsetY=sin( self.Rotation )* self.Size.Width /2

    you can change parameter to positioning emitter correcly
  • RPRP Member Posts: 1,990
    edited July 2013
    Well that's the tricky part. Since the Particles behavior is dealing specifically for that particle and how to control it. Here is a thread that can help you out:

    http://forums.gamesalad.com/discussion/43477/how-to-get-a-particle-emitter-to-stick-to-a-point-on-an-actor
  • -Timo--Timo- Member Posts: 2,313
    thanks @RP and @TheSkin
    EmitterOffsetX=cos( self.Rotation )* self.Size.Width /2
    EmitterOffsetY=sin( self.Rotation )* self.Size.Width /2
    worked fine :) thanks!
  • -Timo--Timo- Member Posts: 2,313
    it's still hard to get the good code... I have an actor with the size of 45width and 70length. I want the particles come out under the actor (when rotation is 0)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Give this a try:
    EmitterOffsetX=cos( self.Rotation -90)* self.Size.Height /2
    EmitterOffsetY=sin( self.Rotation -90)* self.Size.Height /2

    or perhaps:
    EmitterOffsetX=cos( self.Rotation+270 )* self.Size.Height /2
    EmitterOffsetY=sin( self.Rotation +270)* self.Size.Height /2

    notice it says '.Height' not width.
Sign In or Register to comment.