Spawning particles in X,Y (moving actor) direction.
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.
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
-
MotherHoose Posts: 2,456
@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 YMH
Answers
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