How do i set collision on sword for only when i am swinging it at an enemy

so when i play the animation i should be able to set the collsion in character blueprint ?

set boolean on character attack? on the animation it self or in the character event graph? i understand how it should work i just need the pics or something to set it up. the over lap event is in the sword blueprint , the bool doesnt show up there how do i check it?

I see, try this instead. Delete your sword from your level and from the level blueprint. Then go to your character blueprint and on event begin play, use a spawn actor from class node to spawn your sword and use the return value of that node to attach it to your character’s socket.

Now you can also use the return value of that node to set it as variable. Now you have a reference to the sword in your character blueprint and you can call that variable in your animation blueprint by casting to your character and getting that variable.

On the character graph, on the attack input. You’ll have to cast your character to your sword or vice versa. You’re going to have to do some casting no matter what approach you take.

Let’s start with this. How did you originally attach your sword to your character?

in the level blueprint, event begin play, it attatches to socket of my character right hand.

ok cool man thanks i will try but one quick question when i get the variable in the animation blueprint is that when i use the enable collsion node?

Yes exactly. You have to cast it to the sword bp first though, inside the animation blueprint.

i tryed both set ups in screen shots 4 and 6 still not getting any collision, ill try out a few things tommarow, thank you guys for all your help i got my weapon re- attached the other way tho thanks for the tip.

Hmm, take a look at the blueprint debug when you attack, are those anim notifies actually firing?

no it doesnt seem to be firing the anim notify. can the notify be on a basic animation?, or does it have to be on a anim montage?

I’m pretty sure you can do it on a simple animation, but try it on a montage anyway. Also, make sure you have the specific instance of the animation blueprint selected in the debug filter durring runtime.

could the problem possibly be with the way my attack is set i have it set to press F key and animation plays but i noticed F key doesnt fire off events like enable collision i tested it directly through the sword blueprint if i hook up event begin play node and enable collsion it will work, but if i hook it to and F key or any other event key when pressed it will not enable collsion.

That’s probably just because the input is being consumed/overridden by your character input. You’d have uncheck “consume input” on your character blueprint and/or change the priorities.

Awesome thanks man that helped me fix what i need to do and it works pretty good actually not sure how good it will work for combo attacks or anything but collision is setting when i attack and when i stop attacking it disables collision, this how i set it up.

in the player event graph it looks like this