Magnitude attribute stop?
AjBlue
Member Posts: 215
oh so i have a turret running a magitude(turret-enemy) once enemy is within 400, change attribute to true. when attribute is true, timer every 2 seconds: projectile > change attribute x,y to enemy x-25,enemy y+10
i tried having an otherwise change attribute x,y back to start (offscreen)
and having another rule , when projectile is destroyed(collide) change x,y to offscreen
but what happens is once the last enemy on screen is killed the projectile "spawns" back to the last spot it killed an enemy and sits there, this is a problem because when more enemies spawn they would run into the projectile without the turret "firing"
i tried having an otherwise change attribute x,y back to start (offscreen)
and having another rule , when projectile is destroyed(collide) change x,y to offscreen
but what happens is once the last enemy on screen is killed the projectile "spawns" back to the last spot it killed an enemy and sits there, this is a problem because when more enemies spawn they would run into the projectile without the turret "firing"
Comments
On the surface the fix you created may work but might not be optimal. If you want us (or me) to think a little harder on this please post that video so I can get my head around your issue.
the only moveable actors are the actual soldiers. because there is no other way to make an actor move in a direction and make them stop once close to another object
1. It appears the projectile is just being moved to the enemies position (ie: there isn't a visual of the projectile leaving the turret and traveling to the enemy). Am I correct or perhaps I missed it.
2. All enemies get hit and killed ... (ie: the projectile is designed to kill all enemies at the right distance)?
if 1. you don't want the projectile path to be seen. I guess bullets moving so fast they can't be seen is correct and 2. all enemies 'get hit' at a certain distance. Then I would do away with the projectile and just set your enemy to animate a bullet hit at the right distance or even place an invisible actor at that distance and when the enemy collides with that invisible hit actor then animate a bullet hit.
OTHERWISE: I have a project where an archer fires an arrow when the enemy advances to a certain range. The arrow is spawned and has its velocity and rotation set so it travels and falls correctly. However it is not certain to collide with the actor so the actor only dies when it gets hit otherwise arrows collide with the ground and destroy.