Hi Guys. Im making First Person Zombie Shooter and there is a problem can anybody help me?
script is here
void RayShoot()
{
v3DirectionRay = transform.TransformDirection(Vector3.forward);
if(Physics.Raycast(transform.position , v3DirectionRay ,out rhHit , fRange))
{
if(rhHit.rigidbody)
{
int iZombieHealth;
rhHit.rigidbody.AddForceAtPosition(v3DirectionRay * fForce, rhHit.point);
iZombieHealth = rhHit.rigidbody.gameObject.GetComponent<ZombieHealth>().iHealth - 10;
Debug.Log(iZombieHealth);
}
}