Problems About Melee Item Use

Ahrazadam

New member
Hi,
I am trying to set up an NPC character using character controller and BD, however I cannot understand the melee item use system. All I want is that My npc should damage the player while attack animation is inbetween the OnanimatorItemUse and OnanimatorItemUseComplete Events. However It damages the character both before the event and after.

Something confuses is that I use isAbilityActive conditional on my behavior designer and after the OnanimatorItemUseComplete Event it returns false but on my character Use state is still active and it continues to damaging my Player.

Thank you for help and sorry for bad english.
 
Have you looked at the UCC/BD integration demo scene for the melee weapon? It shows how to use the melee weapon in BD. Does the problem with the damage outside the two animation events also occur in the demo scene?
 
Yes, the demo scene also has this issue, It is just hard to see because of the animations and the behaviour the npc has. As far as I understand, only bd "isabilityactive" conditional uses the OnAnimatorItemUseComplete event but Onimpact function looks only at whether the use ability is active. The use ability is also always active while the animation plays. So the impact damage is completely independent of the use events which show what frames are attack frames.
 
Are you using the Behavior Designer integration? If you are and haven't recently updated the integration go ahead and do that - I made a change to the use task.

If it still has the problem let me know and I'll take a closer look at it.
 
Yes, there is still problem. Actually I think I found the problem. Melee Weapon script has a bool variable to check attack frames but onimpack function does not use this bool. Best solutions I have found are either create a state for attacking frames and use this state to apply 0 attack or put attacking frame check boolean in the onimpact funtion. But if I change the script it will be a problem with incoming updates. So to bypass this problem I think I need to subclass this melee weapon script, and use this bool in the impact method. Do you have any advise about subclassing melee weapon script? There are some private variables and methods and there is a notation I couldn't understand: you define a variable public such as speed and then a private variable like m_speed then you bind them with "get;set " thing, What is the purpose of this?
 
Top