Need An Alternative To Collision
Posted: Wed Sep 22, 2010 3:30 am
I have come up against a wall in my game development: I have been trying for days to figure out why my game crashes when I shoot the enemies on the left in the head who are using code copied and pasted from the functioning enemies on the right, and I just can't find a clear reason. All the appropriate names and variables have been accurately substituted, so it's not that, and I have tried several different methods involving collisions with the player sprite and collisions with attack regions, and nothing has worked so far.
I was told it is possible to use distance to determine certain actions, like, if my enemy is close enough to my player when my player fires her gun, the enemy will react as though there had been a collision, though I am uncertain how to specify the particular clone when they are being generated from a spawn actor on a timer. For collisions you would use "event actor" or "collide actor" depending on where the script was, but if I were to use "enemy", it would affect all the enemies of that actor type, would it not?
Does anyone know how I would use distance to determine if an enemy is close enough to react to being shot in the head as an alternative to collisions, which seems to crash my game in this one particular instance no matter how many combinations I come up with, and how I would specify the particular clone close enough to me?
I was told it is possible to use distance to determine certain actions, like, if my enemy is close enough to my player when my player fires her gun, the enemy will react as though there had been a collision, though I am uncertain how to specify the particular clone when they are being generated from a spawn actor on a timer. For collisions you would use "event actor" or "collide actor" depending on where the script was, but if I were to use "enemy", it would affect all the enemies of that actor type, would it not?
Does anyone know how I would use distance to determine if an enemy is close enough to react to being shot in the head as an alternative to collisions, which seems to crash my game in this one particular instance no matter how many combinations I come up with, and how I would specify the particular clone close enough to me?