Custom Zombie No ( HitBox ) Damage to Player - How to Fix?

Vexitron

New member
Hi, I have looked through documentation, tried going through V3 videos (I already successfully installed V3 Team Deathmatch) - but still after several attempts cannot get my iClone Zombie (already set up properly as an AI Agent/Enemy) set to Damage Player Health.
Please see attached video: https://kapp.life/videos/NO-DAMGE-TO-PLAYER.mov

Seems there is no step by step video for setting up a simple Melee Attacker (like a Zombie) for V3, though sword was very helpful.
If possible would you mind listing step by step, what I need to check, set up or enable to make sure the Zombie (RightHand Melee Attack) Damages the Player Health?

As you see in the video I can attack (The video was shortened, but I can kill zombies with the Sword), but the (Exagerated) Melee Weapon/Punch/Claw melee attack from the Zombie does not interact with HitBoxes on my Player (I even added the HitBox Multiplayer to be sure).

Sorry for the Newby vibes- Your help would be appreciated, very much!
 
Hello -

Just for clarification, you are using the Deathmatch AI Kit, correct? What task is currently active when it looks like the agent should be attacking?
 
Good Question. I checked and it was stuck on Determine Weapon - Soo.. I inserted the original/custom Task called "Zombie Attack" - which didn't change anything much, so I added task "Attack Movement", but it was looping on that (Still not doing damage to Player) - though the animation was more like running to the Player (kept rubbing up against player but not attacking). Does that help explain anything? I have added an image for reference.
 

Attachments

  • AttackMovement(Zombie).png
    AttackMovement(Zombie).png
    681.5 KB · Views: 5
It looks like the Determine Weapon task is disabled. That task should be enabled to ensure the correct weapon can be used (in this case it's just the body item). With that said, it looks like you are using a custom behavior tree, correct? Is the Attack task running?
 
Thanks very much for the reply - Here was my result:

Zombie still attacks (After Determine Weapon turned back on) but still no Damage to Player occurs.

1 - I tried turning one the Determine Weapon Task, but it didnt change the outcome/behavior.
The Loop I have been stuck in with this problem is it
2 - Animates fine (either using DEMO or the almost identical ZOMBIE 1 animator (Just swopped out human Walk and Run for Zombie ones, including Zombie Attack animations),
3 - In the Behavior Tree, once the Attacker/Zombie reaches the Determine Weapon the animation plays of either an attack or mainly gets stuck in a loop of IDLE or WALKFORWARD, rarely attacks unless the player wander behind the back of the Zombie, then it freaks out and attacks, but
4 - Still does no Damage - Even though I swopped out the next TASK after Success - it should go to Attack Task, but doesnt.

Just find it odd - the animation attacks, and the collider of my Body /Melee weapon (that big ball called 'SLAPP') should do DAMAGE to the player, but there is no damage to Player ever, not even accidentally colliding with the Right Hand Slapp. I numbered it as Animator ID 21 - but is there a screenshot of settings for a typical PUNCH, that I can copy for Version 3 Opsive? Perhaps the Punches are not 'landing' bc they are mislabeled/categorized?

I sure would love to solve this, as I am almost a month delayed from this particular error.

Your responses have been extremely encouraging, and I am thankful for your support. See attached screenshots - Let me know if you need more screen shots of specific settings, will be happy to squash this bug!
 

Attachments

  • DET-WEAPON-TURNED-ON-DOES-NOT-ATTACK.png
    DET-WEAPON-TURNED-ON-DOES-NOT-ATTACK.png
    590.3 KB · Views: 4
  • DETWEP-ON-NO-ATTCK.png
    DETWEP-ON-NO-ATTCK.png
    686.9 KB · Views: 2
  • DETWAP-NO-ATTACK--DEMO-or-ZOMBIE-ANIMATOR.png
    DETWAP-NO-ATTACK--DEMO-or-ZOMBIE-ANIMATOR.png
    711.7 KB · Views: 2
  • DEFAULT-LOADOUT--SLAP(MELEE-BODY)b.jpg
    DEFAULT-LOADOUT--SLAP(MELEE-BODY)b.jpg
    518.5 KB · Views: 2
  • 3RV-BODY--SLAPP-(MELEE-BODY)-ADDEDb.jpg
    3RV-BODY--SLAPP-(MELEE-BODY)-ADDEDb.jpg
    558.5 KB · Views: 2
ps - If I didnt mention it clearly - Yep, the ATTACK Task was active at some points (see Screenshots), and the animation is the ZOMBIE ATTACK animation appears to happen, though rarely, but even though its a direct hit to the player, nothing registers like in V2 (No red/pain screen, and Player health never diminishes).
 
as mentioned above (Here is screen shot with ATTACK active, no damage to Player Health still).
 

Attachments

  • AttackMovement(Zombie).png
    AttackMovement(Zombie).png
    681.5 KB · Views: 3
Ok, in that case my bet is that it's not a problem with the behavior tree but is a problem with how the item is setup. If you create a user-controlled zombie and attach the body weapon that you are using for your AI agent does it work? My guess is that it won't attack with that either.

Since you replaced the animations did you also make sure to add the animation events? You can optionally use a timer instead: https://opsive.com/support/document...controller/animation/animation-event-trigger/
 
Thankss. Ok, I will check the documentation. I suppose there is no Video to tackle this?
Will see what I can do, as I didn't think about Animation Events... is there any special instructions or setting for Melee Attack (punch)?..or I just apply my custom 'Slapp' attack?

As a bit of a Newb, was not sure how you were able to open the EVENTS with the Animation Bar, but I will figure it out.
Thanks again for your reply and attention.

Will be very happy once this is resolved....and hoping what I learn from this, I can apply to all the characters in this game!
 
You will need to apply the animation events if you aren't using a timer. When you are replacing animations make sure you take a look at the animation that you are replacing to ensure it doesn't have any existing events. I don't remember if I went over animation events in the melee video but Unity's documentation on it is pretty good: https://docs.unity3d.com/Manual/AnimationEventsOnImportedClips.html

The animation event strings that you want to use are OnAnimatorItemUse and OnAnimatorItemUseComplete.
 
Thanks Justin again for the help!! I will read up, and use those animation event strings, plus review your existing melee videos.

I did find an Animation Event in the existing zombie Animation called "ExecuteEvent" (see attached) - Just will need to find out step by step how to make V3 have that deliver Damage/Health to the Player if they collide. Again, appreciate any notes you can supply - but most likely you already sent the answer, I just have to find them in the documentation.

Much appreciated, will post my update asap!

PS - I am using Unity 2021.3.1f - Is that good, or is it recommended I upgrade to Unity 2022?
 

Attachments

  • EXECUTE-EVENT.jpg
    EXECUTE-EVENT.jpg
    309.7 KB · Views: 1
Yeah, ExecuteEvent is the event name and the OnAnimatorItemUse is the string. The Animation Event Trigger link has a good example of it for jump and you can use that same workflow for any event.
 
Hi Justin,
I may have to give up and go back to the working V2, as its been such a long time on one problem/mismatched setting, and now costing a lot each day. I will send you what I did, in hopes it still may work...

Before I share - I wanted to ask: Could it be something to do with Collision Layer Mask? -or- That the Collider of the Melee is either on the wrong Layer or not set up to do damage?

So here are the settings - I also tried to change the script to ZombieAttack, but still not effect. The attached show ExecuteEvent script was chosen. With string as you said "OnAnimatorItemUse". Weird - it changed the script name to the string name.. again sorry for the newbie-ness.

If you can recommend any other way - like timer or whatever will do damage to Player, would be a miracle.
Thanks again!
 

Attachments

  • _______tried.png
    _______tried.png
    43.6 KB · Views: 3
  • ___same--exevent-changes-to-OnAnimatorItemUse.png
    ___same--exevent-changes-to-OnAnimatorItemUse.png
    374.8 KB · Views: 3
It could definitely be related to the layer mask, but since you are using your own animations I doubt that is the cause. You could use the default animations and see if that works - if it does then it's definitely related to the animations.

With that said, your event needs to go on the animation itself rather than on a character controller inspector. This page has the steps: https://docs.unity3d.com/Manual/AnimationEventsOnImportedClips.html. This is outside of the character controller inspectors and is a core Unity feature. For example, this is what we setup on the BodyPunchFromAim animation: 1691495780543.png
 
Top