Advertisement
N1warhead

Ai-Damage

Sep 20th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class AIDamage : MonoBehaviour {
  5.  
  6. // This is how much damage that will be delt to player if
  7. //AI Hits our character.
  8. //Player has a total of 100 health!!!!
  9.  
  10. public float Damage = 1000;
  11.  
  12.  
  13.  
  14. void OnTriggerEnter(Collider col){
  15.  
  16.  
  17. if (col.gameObject.tag == "Player") {
  18. col.gameObject.GetComponent<BasicHealth>().TakeDamage (Damage);
  19. Debug.Log ("HIT");
  20.  
  21. }
  22. }
  23. }// THIS IS FOR TRIGGERING DAMAGE TO PLAYER.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement