A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Now in Beta! Get 1:1 live lessons on any Unity topic or help troubleshooting your project – Connect with an expert on Unity Live Help
Discussion in 'FPS.Sample Game' started by IanHonorato, Jun 6, 2019.
I'm trying without sucesses to set a colisor for headshots
There is already a collider for the head but a detection for headshots are not implemented by Unity for this sample.
So you will need to have to do that yourself.
Once you check if a shot has hit anything you can do an extra check to see what it hit.
Each player model uses their own collider model and this already has colliders for each body part.
In our game we have 5 different zones on the player models body with different damage multiplier including a headshot detector.
I can't remember which files were changed but it shouldn't be that hard to find.
Do you maybe remember where the damage multiplication happens, when you hit a collider. I could manage to find the part where you set the HitInfo enum to define bodyParts and where the check happens wich body part should be seted. But i could not find the part where this sections are actual used and decisions of the damage output happens depended on the body part of the current hitted collider.
Then you need to make a bool when the different body parts are hit and send that to each weapon.
In those weapon scripts you can make an if statement to do different amount of damage either by multiplying the original damage or make more damage vars for each part, like we did.
We have 5 zones for each weapon and then we set each variable in each weapons asset files.
i think it is better to make enum, not bools
You can do it however fits your need.
I'm just pointing in a direction for a solution.