I have a project where after a certain time interval 2 NPCs are generated in different locations on the map.
Each of them collides with a collision box that defines its "class" (red or blue):
When 2 NPCs collide it was to be verified a condition (if the "class" of the involved ones is different) and from there both are destroyed, but nothing happens:
I put a print right after the Cast To NPC to see if it was happening and when they are generated the impression appears four times.
Blueprint:
Result in game:
I'd like to know how to set a cast only between two instances of the same actor.
Image showing that nothing happens when it (two instances of the same actor) collide:
I did the test with both codes (printing and destroying both).
EDIT 1 (I was being redundant)
In the code of destruction, I can simply put it to destroy itself only, because as it will run in both instances, the two will destroy themselves:
I'd still like to know how to correctly detect the collision between two instances of the same actor, but now I know that the code will be running twice, once in instance A and again in instance B.
No comments:
Post a Comment