- Home /
FPS Problem Help!
I have this FPS shooter and an AI script ive added im trying to make it work with my Health script and it does but the problem is sometimes without the npc even being on the screen it shows blood splatters as if it was hitting the object, so theres something missing I cant figure it out..
ase 13://hit object is an NPC
if(hit.collider.gameObject.GetComponent<CharacterDamage>()){
hit.collider.gameObject.GetComponent<CharacterDamage>().ApplyDamage(damage, direction, mainCamTransform.position);
hit.collider.gameObject.SendMessage(damageMethodName, damage, SendMessageOptions.DontRequireReceiver);
}
else if (hit.collider.gameObject.GetComponent<AdvancedAiEnemy>() ||
hit.collider.gameObject.GetComponent<AdvancedAiCompanion>() ||
hit.collider.gameObject.GetComponent<AdvancedAiDefender>() ||
hit.collider.gameObject.GetComponent<AdvancedAiNpcAggressive>() ||
hit.collider.gameObject.GetComponent<AdvancedAiNpcPassive>())
{
hit.collider.gameObject.SendMessage("GotHit", damage, SendMessageOptions.DontRequireReceiver);
}
You should title questions to give an idea of the problem. It is also hard to understand what your problem is because of your wandering, run-on sentence. You need to explain what object is making blood splatters, what happened before the random blood splatters, and what you want to happen.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Complete AI Tutorial? 1 Answer
My Eneny AI Script Wont Work? 2 Answers
Enemy Collision Wont Work! PLEASE HELP 0 Answers
Instantiate Projectile towards player (regardless of transform.rotation) 2 Answers