My player has a melee weapon (a stick). This is a static mesh with collision all around it and is not a part of the player itself (just attached via socket).
I am trying to figure out a way to identify an overlap event and do damage to whatever it is I hit (static mesh, other player etc).
I only want the event to happen when I attack, I do not want an overlap event to happen if my weapon mesh touches something, only when it plays the attack animation.
Don’t worry! You can do it whit matinee.
For now you can use the delay solution.
If you want take a screenshot of your blueprints would be good for any help
Hi, I have added a delay and a branch when I attack which works. I really dont understand the other methods as I am new to ue4. I just want a basic event that calculates when I attack and hit something. Then from that I can trigger other events to happen.
The issue with the delay is that some animations will be longer than others.
Thanks for the help by the way but is there any way you could simplify things for me please?
Also I have anim montages for my attacks. I can not add them in the state machine tree. And when I ■■■ the attack animation (not montage) my legs will not move at the same time as the attacks…
I have managed to print a string when overlap begins (when I attack) sometimes the string triggers once but other times the string can trigger multiple times as it depends how long the overlap lasts. Is there any way I can calculate a damage variable based on how long my overlap is?
After some tweaks things are getting better. It was actually my player capsule collision which was being trigger by a overlap event so I have told the overlap to ignore the player collision capsule. Now when I attack a mesh the hit detection is alright. But how do I make it more accurate?
Yes this method is inaccurate… You can use a get play length node from your animation and supply your delay time input.
But the best way from my point is to add a curve inside your animation, you should see a curve section in your animation, add a curve and you 'll have the animated variable, that way you can also drive the power of your attack during the animation or the effectiveness.