Unable to destroy actor instances using linetrace detection by tag and enumerator.

Hello Folks.

I’ve tried to do the following. I’m spreading a set of actors (static meshes) around the level so the player can search for them, once the line trace detects them by a tag “pickup” the line trace enables a boolean “isAbleToInteract”.

During the moment the value of the boolean is true the player can press right-click to interact. The interact input triggers a custom event that destroys the actor. Of course, is there’s no further instruction the event would destroy all instances.

What I want is to destroy only the instance the player is interacting with.

So in order to do so, I tried several things, (none of them worked so far)

  1. I created a second tag for each of them so I could call them by the riight tag.
  2. I created a switch on int adding the 1,2,3,4 to each instance.
  3. I created a for each loop so I could detect when they have the right subtag.
  4. I create an array of tags and then names, but I’m unable to make it work.

Any help would be appreciated.

Hi there @NaldoSand. Hope you’re well!

This topic has been moved from International to Programming & Scripting: Blueprint.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing :slight_smile: