Hello, i’ve been trying to create FPS with separate damage to body Parts. I’ve set up box collider on the head bones, and the body. So far I’ve been able to hit the head and body separately.
The problem is, where should i put the script to store the damage received for my enemy? Because if i put the script on the body, every time the ray cast hit the head collider, it won’t run the script to reduce the health (Which i put on the body). I could change the health variable to static, but i plan to have multiple enemy, and if i make them static, it will reduce all of the health from the enemy i didn’t even hit.
Is there anyway i can combine damage from body, head, foot etc into one enemy object? I want to use same script for all of my enemy, or do i need to create separate different script for each enemy?
thanks for the help.