Spawning particles in X,Y (moving actor) direction.

DanielDoeDanielDoe Member Posts: 307
edited May 2012 in Working with GS (Mac)
Is there any way to spawn particles in X,Y (moving actor) direction?

I have a player that is moving around some object that is emitting particles. I want the particles to be emitting in player's direction. I have external constrain of X and Y player position but can't (don't know how to) use it. VectorToAngle doesn't work in this case.

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    edited May 2012 Accepted Answer
    @danielhalat … vectorToAngle works … but think you may not have the complete angle

    on your spawnerActor … ParticlesBehavior … Velocity/Position:

    Direction:
    vectorToAngle( game.movingX - self.Position.X , game.movingY - self.Position.Y )

    ==
    a vector is a line segment … and all lines need a startPoint and an endPoint

    the naming of (x,y) parameters in the vectorToAngle function … can be confusing
    … "x and y" both need a startPoint and an endPoint
    the movings X minus the spawner's X … the moving's Y minus the spawner's Y

    image MH

Answers

  • DanielDoeDanielDoe Member Posts: 307
    Works! I just didn't know that I have to divide moving object X by spawner X etc.... thanks.
  • MotherHooseMotherHoose Member Posts: 2,456
    well… we all had to learn that one! @danielhalst

    some things come easy; some things come hard
    I try not to dwell on things I don't know … till I need to use them

    image MH
Sign In or Register to comment.