Equip a weapon on enemy when spwan

It’s not working this way .

How to choose the good BP to cast? I mean the actor BP of the weapon chosen.

I think I need to set simulate physics in the event graph of each WeaponBP, but how ?

Yes, in each one, set the mesh to simulate physics.

I dont think.
If i do this the weapon go ragdoll when the weapon spawn

Thank for your help, I just understand now.

Ok cool :slight_smile:

FYI: You can avoid that multiple casting by using class inheritance. You make one weapon BP, and then make child classes for each type of gun…

I’ve found the way to make child class for all the guns. how to cast the good class?

Now you can just cast to the parent class.

That might work. But what I meant is, if you have a parent weapon class, you just cast to that class ( like normal ).

Like this ?

Ok I understand. Without the get class node

next step: change all the animations of the enemy if he get some type of weapon :slight_smile:

I’ve found how to change the animationBP of the enemy Mesh according to the weapon equipped.

But there is still a problem for the hit reaction animation. !

In the last branch play montage will work only the condition is false. If condition is true, no animation played and the rgdoll of the weapon is broke again. I dont understand

looks ok to me, put a print in there to check it’s going the way you think it should…

When it’s false th 1st print comes, then no animation, then 2nd print comes. And the ragdoll of the weapon is broke again.

I have no idea, sorry…