Issue with enemy fire
I am working on a game that has a firing mechanism for the player and includes, NPC return fire. The firing works fine, destroy on collision works fine when the enemy is hit and is very precise in hitting the target being necessary to destroy the actor; the problem comes in when the player receives return fire. The player actor dies when the enemy fire is literally as far away from the actor as the actor is large. The player actor also dies at some times when the enemy fire has already left the screen. It is a basic "when actor receives event" "Overlaps or collides with" "bullet" with a "destroy actor" on both the bullet and the player character, and upon death - the player character has a "spawn actor" "death animation". Everything works perfect, except the player dying without getting hit. If this topic has previously been addressed, I apologize, but I was unable to find it in the forum search. Any help is greatly appreciated!
Comments
tell the bullet
If colliding with P1
Do
if distance from P1.X.Position < 15
and if distance from p1.y.pos <15
Do Death stuffs
to get distances like that I believe you can use the magnitude function. TSB has a tut on this fosheezy.
this makes a circular collision radius.
Thank you! Its been driving me crazy trying to figure out how to fix the problem.