Hi guys I want to attach weapon blueprint to my NPC but no matter what i try it is not working for me.
Here is that sword which i want to be attached:
I dont want to create this whole weapon with hit functions in my NPCs because It would be really pain in the a** if i would have like 50 NPCs in game. By the way this weapon is used by Player character too but that metod wont work for my NPC.
You mean like this?
Because exactly this i tried and its not working not even attach to actor work. (I cast it to itself because when i dont cast it then it cant read GET node. Dont know why)
Don’t use “Get all actors of class”. Make a variable in your Master_EnemyBP. Let’s assume the name of the variable is “Temp”. The variable type should be “Uruk_Sword_BP Object reference”. Now, you can use this variable as the input to “Target” in AttachToComponent node. Try this.
“Temp” need to be refferenced somehow or it would be empty and i will get error: None trying to read property. So it cant be like you said.
“Temp” would be a class variable that you create directly in the master BP for your enemy class. So when you go to attach an actor to that npc you reference that variable. In the variable you create search for the Uruk_Sword_BP Class" not the object. It should be purple if that helps. This does work because this is how I attach turrets to my npc’s. However I’m using 4.17.1
I dont really get what you meant because you cant attach class variable to “Attach to Component/ Attach to Actor” and you cant even get refference from class variable so I created something like this but its still saying this error : Accessed None trying to read property Call_FuncFinishSpawningActor_ReturnValue from function Equip.
I know what it mean but dont know how to solve it. I tried to set Actor variable there but then error just moved to none trying to read… that variable.
Ok i got it working. I am just dumbass… I did not set default class for my class variable…
Problem Solved!!!

Here is an example of how you can do it the way we are suggesting. You could also use BladeMaster’s advice. And another way is to go into the NPC BP and click add component, add child actor and attach it that way.