Skip to main content
edited tags
Link
Boneco Sinforoso
  • 681
  • 1
  • 20
  • 47
added 489 characters in body
Source Link
Boneco Sinforoso
  • 681
  • 1
  • 20
  • 47

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):

enter image description here

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:

enter image description here

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:

enter image description here

Result in game:

enter image description here

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:

enter image description here

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:

enter image description here

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.

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):

enter image description here

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:

enter image description here

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:

enter image description here

Result in game:

enter image description here

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:

enter image description here

I did the test with both codes (printing and destroying both).

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):

enter image description here

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:

enter image description here

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:

enter image description here

Result in game:

enter image description here

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:

enter image description here

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:

enter image description here

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.

Source Link
Boneco Sinforoso
  • 681
  • 1
  • 20
  • 47

Error detecting collision with another instance of the same actor?

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):

enter image description here

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:

enter image description here

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:

enter image description here

Result in game:

enter image description here

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:

enter image description here

I did the test with both codes (printing and destroying both).