I've an annoying Attach/Detach Actor problem

Hi friends! I’ve posted this thread here: I've a problem with Attach/Detach Actor - Programming & Scripting - Unreal Engine Forums but I’ll come back on Tuesday/Wednesday and I hope someone can help me on this forum or on AnswerHub during the next days.

I have a problem with (English language LOL) Attach/Detach Actor.

Firstly my Blueprint for you:

Part 1

Part 2

Ok, I use this BP for every single weapon. It’s very good, because it give me what I want: take/leave a weapon when I press Q near it (every weapon give me some different bullets, but that’s another story).

Unfortunately when I’ve a weapon (Weapon A) attacched to my socket and I want to take another weapon (Weapon B) because I’m near it, Weapons A doesn’t detach from the socket and my character has 2 Weapon attached.

I’ve tried without success with many variables, nodes (Cast to, Detach Actor from Actor, Delay and some Flow Control nodes) and Blueprint Interfaces. I need something for detach/destroy Weapon A before attach Weapon B when I’m near Weapon B (near = Weapon B BoxComponent), but I think I need something like “priority” when I press Q.

Please, let me know :slight_smile:

UPDATE

I’ve:

  • deleted “Detach from Parent” node;
  • connected “Get Player Character” to “Get Actor Transform” (replacement for “Maintain World Position” bool pin of “Detach from Parent” node);

but the result is the same :frowning:

I don’t know if this is your specific problem, but you are destroying yourself before calling the SpawnActor node. I don’t think SpawnACtor will execute - Blueprints no longer execute on destroyed Actors.

Hi James, many thanks for your answer! The problem WAS the flag on the “Consume Input” option of Press Q EventS. I’ve deflagged them and now it’s perfect!