UnityThirdPerson - Ragdoll on death - Enemy not hitting player

I am working on the ‘Ragdoll On Death’ part of the tutorial.
I have completed it twice now and end up with the same result.

Before starting the tutorial, I confirmed the Enemy can hit and knockback the player, and that the player can hit and knockback the enemy.

When I have finished the tutorial, the player can hit and knockback the enemy and the enemy becomes a ragdoll.
But when the Enemy tries to hit the player, the enemy is not hitting the player at all, its like his sword just goes through the player.

I haven’t been able to find where the problem is, and am hoping someone can help.
I have copied all the code from the commit to rule out any typos/errors that I may have made.

Here is the Player Inspector:

Here is the Enemy Inspector:

Hopefully someone can see what i have done wrong.

Thanks

Al

You have your enemy on the ragdoll layer. Only the objects that are part of the ragdoll should be on the ragdoll layer

1 Like

Thanks for that, I definitely got that wrong. I redid the tutorial and fixed the issue, but the same problem still exists. The player can hit and kill the enemy and the enemy turns into a rag doll, but the enemy still cannot hit the player.

One difference I noted when app,ting the rag doll to all the armature, a little later the instructor selects all the armature to tag it as Ragdoll, and you can see the WeaponLogic game object in the list that they do not select. When I got to that part of the tutorial, I could not see the WeaponLogic game object in the enemy. So I can only assume the WeaponLogic game object is somewhere inside the right arm rig and that I might be selecting it when I add the ragdoll tag. Because I am still pretty new to Unity, I am not sure what effect this will have. Any of the brains trust able to shed some light on that to confirm if this is my issue, or if it is potentially something else. Lol it will make my game way too easy if the enemies cannot hit the player hahaha.

Hey I found the issue, somehow the enemy WeaponLogic lost its capsule collider. I re-added it and everything seems to be working now.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms